[sendmail] Fixed systemctl disable command in preun section Replaced reload by restart, dropped ExecReload from

Jaroslav Škarvada jskarvad at fedoraproject.org
Mon Jul 25 14:16:44 UTC 2011


commit a25ef5c9379dc4cb164d3be1ada0721549964ea0
Author: Jaroslav Škarvada <jskarvad at redhat.com>
Date:   Mon Jul 25 16:16:30 2011 +0200

    Fixed systemctl disable command in preun section
    Replaced reload by restart, dropped ExecReload from sendmail.service
    Resolves: rhbz#719931
    Switched to systemctl in NetworkManager dispatcher script
    Added ExecStartPre=-/etc/mail/make to sm-client.service
    Hardcoded daemon option (-bd) to sendmail.service, dropped the DAEMON var
    QUEUE var in /etc/sysconfig/sendmail replaced by SENDMAIL_OPTS var
    Added default preset (-q1h) to SENDMAIL_OPTS var

 sendmail.nm-dispatcher |    2 +-
 sendmail.service       |    5 ++---
 sendmail.spec          |   16 +++++++++++++---
 sendmail.sysconfig     |    3 +--
 sm-client.service      |    4 +++-
 5 files changed, 20 insertions(+), 10 deletions(-)
---
diff --git a/sendmail.nm-dispatcher b/sendmail.nm-dispatcher
index 75dceb9..fe74171 100644
--- a/sendmail.nm-dispatcher
+++ b/sendmail.nm-dispatcher
@@ -2,6 +2,6 @@
 
 case "$2" in
 	up|down|vpn-up|vpn-down)
-		/sbin/service sendmail reload || :
+		/bin/systemctl restart sendmail.service || :
 		;;
 esac
diff --git a/sendmail.service b/sendmail.service
index d8ef02b..e11d02c 100644
--- a/sendmail.service
+++ b/sendmail.service
@@ -7,12 +7,11 @@ Wants=sm-client.service
 [Service]
 Type=forking
 PIDFile=/run/sendmail.pid
+Environment=SENDMAIL_OPTS=-q1h
 EnvironmentFile=-/etc/sysconfig/sendmail
 ExecStartPre=-/etc/mail/make
 ExecStartPre=-/etc/mail/make aliases
-ExecStart=/usr/sbin/sendmail $DAEMON $QUEUE $SENDMAIL_OPTARG
-ExecReload=-/etc/mail/make
-ExecReload=-/etc/mail/make aliases
+ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG
 
 [Install]
 WantedBy=multi-user.target
diff --git a/sendmail.spec b/sendmail.spec
index 303a72e..38692ed 100644
--- a/sendmail.spec
+++ b/sendmail.spec
@@ -14,7 +14,7 @@
 Summary: A widely used Mail Transport Agent (MTA)
 Name: sendmail
 Version: 8.14.5
-Release: 5%{?dist}
+Release: 6%{?dist}
 License: Sendmail
 Group: System Environment/Daemons
 URL: http://www.sendmail.org/
@@ -531,9 +531,9 @@ exit 0
 
 %preun
 if [ $1 = 0 ]; then
-	/bin/systemctl --no-reload sendmail.service > /dev/null 2>&1 || :
+	/bin/systemctl --no-reload disable sendmail.service > /dev/null 2>&1 || :
 	/bin/systemctl stop sendmail.service > /dev/null 2>&1 || :
-	/bin/systemctl --no-reload sm-client.service > /dev/null 2>&1 || :
+	/bin/systemctl --no-reload disable sm-client.service > /dev/null 2>&1 || :
 	/bin/systemctl stop sm-client.service > /dev/null 2>&1 || :
 	%{_sbindir}/alternatives --remove mta %{_sbindir}/sendmail.sendmail
 fi
@@ -676,6 +676,16 @@ exit 0
 
 
 %changelog
+* Mon Jul 25 2011 Jaroslav Škarvada <jskarvad at redhat.com> - 8.14.5-6
+- Fixed systemctl disable command in preun section
+- Replaced reload by restart, dropped ExecReload from sendmail.service
+  Resolves: rhbz#719931
+- Switched to systemctl in NetworkManager dispatcher script
+- Added ExecStartPre=-/etc/mail/make to sm-client.service
+- Hardcoded daemon option (-bd) to sendmail.service, dropped the DAEMON var
+- QUEUE var in /etc/sysconfig/sendmail replaced by SENDMAIL_OPTS var
+- Added default preset (-q1h) to SENDMAIL_OPTS var
+
 * Fri Jul 22 2011 Jaroslav Škarvada <jskarvad at redhat.com> - 8.14.5-5
 - Fixed SMTP AUTH over TLS in case of two AUTH lines
   Resolves: rhbz#716628
diff --git a/sendmail.sysconfig b/sendmail.sysconfig
index 68dc6bc..db73530 100644
--- a/sendmail.sysconfig
+++ b/sendmail.sysconfig
@@ -1,2 +1 @@
-DAEMON="-bd"
-QUEUE="-q1h"
+SENDMAIL_OPTS="-q1h"
diff --git a/sm-client.service b/sm-client.service
index dbd4465..43ff04e 100644
--- a/sm-client.service
+++ b/sm-client.service
@@ -6,11 +6,13 @@ Wants=sendmail.service
 [Service]
 Type=forking
 PIDFile=/run/sm-client.pid
+Environment=SENDMAIL_OPTS=-q1h
 EnvironmentFile=-/etc/sysconfig/sendmail
 ExecStartPre=/bin/touch /run/sm-client.pid
 ExecStartPre=/bin/chown smmsp:smmsp /run/sm-client.pid
 ExecStartPre=-/sbin/restorecon /run/sm-client.pid
-ExecStart=/usr/sbin/sendmail -L sm-msp-queue -Ac $QUEUE $SENDMAIL_OPTARG
+ExecStartPre=-/etc/mail/make
+ExecStart=/usr/sbin/sendmail -L sm-msp-queue -Ac $SENDMAIL_OPTS $SENDMAIL_OPTARG
 
 [Install]
 WantedBy=multi-user.target


More information about the scm-commits mailing list