diff options
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 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%/*} } |