diff options
author | Valery Kartel <valery.kartel@gmail.com> | 2016-12-23 19:37:34 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2017-02-07 14:04:33 +0200 |
commit | f471c42b59a4aed5eab049515028dc8d21f7b1c2 (patch) | |
tree | 75bc0f3b5d66f9c9daa3e03ae8fa6762fcac836e /community/opendkim/opendkim.initd | |
parent | 5938bc9c571af2e1dee1c919b99db90dbccfa1d0 (diff) |
community/opendkim: fixes in build
fix user creation and db directory permissions
fix init.d script - explictly set process-owner and pid-file.
add post-install to generate initial keypair
move non-server binaries and perl-depended script to -utils subpackage
Diffstat (limited to 'community/opendkim/opendkim.initd')
-rw-r--r-- | community/opendkim/opendkim.initd | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/community/opendkim/opendkim.initd b/community/opendkim/opendkim.initd index 843798f5ada..2a6a4101bfb 100644 --- a/community/opendkim/opendkim.initd +++ b/community/opendkim/opendkim.initd @@ -1,10 +1,12 @@ #!/sbin/openrc-run +owner=opendkim pidfile=/run/opendkim/opendkim.pid - +cfgfile=/etc/opendkim/opendkim.conf command=/usr/sbin/opendkim -command_args="-f ${EXTRA_OPTS}" +command_args="$command_args -u $owner -f" command_background=yes +required_files="$cfgfile" depend() { need net @@ -12,5 +14,9 @@ depend() { } start_pre() { - checkpath -d -o opendkim:opendkim -m755 /run/opendkim + local socket=$(grep ^Socket.*local: $cfgfile | cut -d: -f2) + local basedir=$(grep ^BaseDirectory $cfgfile | awk '{print $2}') + [ "${socket:0:1}" = "/" ] && checkpath -d -o $owner ${socket%/*} + [ "$basedir" ] && checkpath -d -o $owner $basedir + checkpath -d -o $owner ${pidfile%/*} } |