aboutsummaryrefslogtreecommitdiffstats
path: root/main/dkimproxy/dkimproxy.out.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.out.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.out.initd')
-rw-r--r--main/dkimproxy/dkimproxy.out.initd38
1 files changed, 15 insertions, 23 deletions
diff --git a/main/dkimproxy/dkimproxy.out.initd b/main/dkimproxy/dkimproxy.out.initd
index 87c5df94a3..ed8fdc356a 100644
--- a/main/dkimproxy/dkimproxy.out.initd
+++ b/main/dkimproxy/dkimproxy.out.initd
@@ -1,31 +1,23 @@
#!/sbin/openrc-run
+# Upper case variables are here only for backward compatibility.
+: ${cfgfile:=${CONFIGFILE:-"/etc/dkimproxy/dkimproxy_out.conf"}}
+: ${user:="root"} # root is default just for backward compatibility
+: ${group:="$user"}
+
description="SMTP proxy that verifies signature on outgoing messages"
-depend() {
- need net
- after firewall
-}
+command="/usr/sbin/dkimproxy.out"
+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.out"
- start-stop-daemon --start -q --exec /usr/sbin/dkimproxy.out \
- --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.out"
- start-stop-daemon --stop -q --pidfile "${PIDFILE}"
- eend $?
+depend() {
+ need net
+ before opensmtpd postfix smtpd
+ after firewall
}