From f471c42b59a4aed5eab049515028dc8d21f7b1c2 Mon Sep 17 00:00:00 2001 From: Valery Kartel Date: Fri, 23 Dec 2016 19:37:34 +0200 Subject: 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 --- community/opendkim/opendkim.initd | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'community/opendkim/opendkim.initd') diff --git a/community/opendkim/opendkim.initd b/community/opendkim/opendkim.initd index 843798f5ad..2a6a4101bf 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%/*} } -- cgit v1.2.3