diff --git a/debian/DEBIAN/postinst b/debian/DEBIAN/postinst index eb09f8e..5225f1b 100644 --- a/debian/DEBIAN/postinst +++ b/debian/DEBIAN/postinst @@ -148,7 +148,7 @@ if [ -f '/lib/systemd/system/mailscanner.service' ]; then fi # Check for systemd -if [ -d '/usr/lib/systemd' ]; then +if [ -f '/lib/systemd/systemd' -o -f '/usr/lib/systemd/systemd' ]; then cp /usr/lib/MailScanner/systemd/ms-systemd /lib/systemd/system/mailscanner.service # add symlink to init script elif [ ! -L '/etc/init.d/mailscanner' ]; then @@ -269,7 +269,7 @@ if [ -f '/etc/clamav/clamd.conf' ]; then sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/clamav/clamd.conf fi -if [ -d '/usr/lib/systemd' ]; then +if [ -f '/lib/systemd/systemd' -o -f '/usr/lib/systemd/systemd' ]; then systemctl enable mailscanner.service else update-rc.d mailscanner defaults 80 80 diff --git a/rhel/mailscanner.spec b/rhel/mailscanner.spec index 375643d..35aa6d9 100644 --- a/rhel/mailscanner.spec +++ b/rhel/mailscanner.spec @@ -525,7 +525,7 @@ if [ -d '/usr/share/MailScanner/reports' -a ! -L '/etc/MailScanner/reports' ]; t fi # RHEL/CentOS7/Fedora >14 -if [ -d '/usr/lib/systemd' ]; then +if [ -f '/lib/systemd/systemd' -o -f '/usr/lib/systemd/systemd' ]; then # copy in systemd wrapper and sendmail services if [ -d '/usr/lib/systemd/system' -a ! -e '/usr/lib/systemd/system/mailscanner' -a -f '/usr/lib/MailScanner/systemd/ms-systemd' ]; then cp /usr/lib/MailScanner/systemd/ms-systemd /usr/lib/systemd/system/mailscanner.service @@ -589,7 +589,7 @@ exit 0 %preun if [ $1 = 0 ]; then # We are being deleted, not upgraded - if [ -d '/usr/lib/systemd' ]; then + if [ -f '/lib/systemd/systemd' -o -f '/usr/lib/systemd/systemd' ]; then systemctl stop mailscanner.service >/dev/null 2>&1 systemctl disable mailscanner.service rm -f /usr/lib/systemd/system/mailscanner.service @@ -1171,6 +1171,9 @@ exit 0 %changelog +* Mon Jul 24 2017 Shawn Iverson +- Better detection of systemd + * Wed May 3 2017 Shawn Iverson - Add RHEL/CentOS 7 systemd support for mailscanner and sendmail diff --git a/suse/mailscanner.spec b/suse/mailscanner.spec index 7eb3548..d062ebe 100644 --- a/suse/mailscanner.spec +++ b/suse/mailscanner.spec @@ -509,7 +509,7 @@ if [ -d '/usr/share/MailScanner/reports' -a ! -L '/etc/MailScanner/reports' ]; t fi # Check for systemd -if [ -d '/usr/lib/systemd' -a -f '/usr/lib/MailScanner/systemd/ms-systemd' ]; then +if [ -f '/lib/systemd/systemd' -o -f '/usr/lib/systemd/systemd' ]; then cp /usr/lib/MailScanner/systemd/ms-systemd /usr/lib/systemd/system/mailscanner.service # create init.d symlink elif [ -d '/etc/init.d' -a ! -L '/etc/init.d/mailscanner' -a -f '/usr/lib/MailScanner/init/ms-init' ]; then @@ -1104,6 +1104,9 @@ exit 0 %changelog +* Mon Jul 24 2017 Shawn Iverson +- Better detection of systemd + * Sun May 28 2017 Shawn Iverson - mailscanner systemd support for SuSE Linux