[fix] adding SYSTEMD detection in alternc.install to run opendkim properly

This commit is contained in:
Benjamin Sonntag 2018-10-25 15:49:21 +02:00
parent 7e8d5487e3
commit 15ec54d41c
1 changed files with 10 additions and 1 deletions

View File

@ -76,6 +76,14 @@ fi
. /usr/lib/alternc/functions.sh . /usr/lib/alternc/functions.sh
# get the information on running Sysv or Systemd init & boot system
if [ -e /run/systemd/system ]
then
SYSTEMD=1
else
SYSTEMD=0
fi
# Lock the jobs ! # Lock the jobs !
lock_jobs lock_jobs
@ -649,7 +657,8 @@ touch /etc/opendkim/TrustedHosts /etc/opendkim/SigningTable /etc/opendkim/KeyTab
grep -q "^127.0.0.1\$" /etc/opendkim/TrustedHosts || echo "127.0.0.1" >>/etc/opendkim/TrustedHosts grep -q "^127.0.0.1\$" /etc/opendkim/TrustedHosts || echo "127.0.0.1" >>/etc/opendkim/TrustedHosts
grep -q "^localhost\$" /etc/opendkim/TrustedHosts || echo "localhost" >>/etc/opendkim/TrustedHosts grep -q "^localhost\$" /etc/opendkim/TrustedHosts || echo "localhost" >>/etc/opendkim/TrustedHosts
grep -q "^$PUBLIC_IP\$" /etc/opendkim/TrustedHosts || echo "$PUBLIC_IP" >>/etc/opendkim/TrustedHosts grep -q "^$PUBLIC_IP\$" /etc/opendkim/TrustedHosts || echo "$PUBLIC_IP" >>/etc/opendkim/TrustedHosts
if [ "$(lsb_release -s -c)" == 'stretch' ] ; then
if [ "$SYSTEMD" = "1" -a "$(lsb_release -s -c)" = "stretch" ] ; then
/lib/opendkim/opendkim.service.generate /lib/opendkim/opendkim.service.generate
# Without adding '-u opendkim' after the service file is generated, opendkim # Without adding '-u opendkim' after the service file is generated, opendkim
# will run as root, which we do not want. # will run as root, which we do not want.