From 15ec54d41c750c41fe83591bf11c58d716ec201d Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Thu, 25 Oct 2018 15:49:21 +0200 Subject: [PATCH] =?UTF-8?q?[fix]=C2=A0adding=20SYSTEMD=20detection=20in=20?= =?UTF-8?q?alternc.install=20to=20run=20opendkim=20properly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/alternc.install | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/install/alternc.install b/install/alternc.install index 692460d5..b56eaf55 100755 --- a/install/alternc.install +++ b/install/alternc.install @@ -76,6 +76,14 @@ fi . /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_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 "^localhost\$" /etc/opendkim/TrustedHosts || echo "localhost" >>/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 # Without adding '-u opendkim' after the service file is generated, opendkim # will run as root, which we do not want.