aboutsummaryrefslogtreecommitdiffstats
path: root/main/dkimproxy/dkimproxy.in.initd
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-05-04 23:53:34 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-05-05 00:12:50 +0200
commit0b8d58570a655b3b0161eba28b687ce33b614038 (patch)
tree39ae38132ccf44424c6d042f7c2688db80cbb5d6 /main/dkimproxy/dkimproxy.in.initd
parent01542623ef7125b2dc1f9b4c8769c387ec1948f4 (diff)
downloadaports-0b8d58570a655b3b0161eba28b687ce33b614038.tar.bz2
aports-0b8d58570a655b3b0161eba28b687ce33b614038.tar.xz
main/dkimproxy: rewrite runscripts, run as dkimproxy user/group
When user upgrade this package and do not update confd files, then it will still run as root, for backward compatibility.
Diffstat (limited to 'main/dkimproxy/dkimproxy.in.initd')
-rw-r--r--main/dkimproxy/dkimproxy.in.initd38
1 files changed, 15 insertions, 23 deletions
diff --git a/main/dkimproxy/dkimproxy.in.initd b/main/dkimproxy/dkimproxy.in.initd
index f7932ef467..915e36a740 100644
--- a/main/dkimproxy/dkimproxy.in.initd
+++ b/main/dkimproxy/dkimproxy.in.initd
@@ -1,31 +1,23 @@
#!/sbin/openrc-run
+# Upper case variables are here only for backward compatibility.
+: ${cfgfile:=${CONFIGFILE:-"/etc/dkimproxy/dkimproxy_in.conf"}}
+: ${user:="root"} # root is default just for backward compatibility
+: ${group:="$user"}
+
description="SMTP proxy that verifies signature on incoming messages"
-depend() {
- need net
- after firewall
-}
+command="/usr/sbin/dkimproxy.in"
+command_args="--conf_file=$cfgfile ${command_args:-${OPTS:-}}"
+command_background="yes"
-checkconfig() {
- if [ ! -f ${CONFIGFILE} ]; then
- eerror "Missing configuration file ${CONFIGFILE}"
- return 1
- fi
-}
-
-start() {
- checkconfig || return 1
- ebegin "Starting dkimproxy.in"
- start-stop-daemon --start -q --exec /usr/sbin/dkimproxy.in \
- --pidfile "${PIDFILE}" --make-pidfile --background \
- -- --conf_file=${CONFIGFILE} ${OPTS}
- eend $?
-}
+pidfile="/run/$RC_SVCNAME.pid"
+start_stop_daemon_args="--user $user --group $group"
+required_files="$cfgfile"
-stop() {
- ebegin "Stopping dkimproxy.in"
- start-stop-daemon --stop -q --pidfile "${PIDFILE}"
- eend $?
+depend() {
+ need net
+ before opensmtpd postfix smtpd
+ after firewall
}