From 9025eb33eb4a2729f1dac04152f1dc22aeb1f93c Mon Sep 17 00:00:00 2001 From: Thomas Woerner Date: Thu, 4 Oct 2007 13:39:00 +0000 Subject: [PATCH] - made init script lsb conform (#243286, rhbz#247025) - added link to postfix sasl readme into Postfix-SASL-RedHat readme --- README-Postfix-SASL-RedHat.txt | 2 ++ postfix-etc-init.d-postfix | 49 +++++++++++++++++++++++----------- postfix.spec | 6 ++++- 3 files changed, 41 insertions(+), 16 deletions(-) diff --git a/README-Postfix-SASL-RedHat.txt b/README-Postfix-SASL-RedHat.txt index f39093e..136d7f0 100644 --- a/README-Postfix-SASL-RedHat.txt +++ b/README-Postfix-SASL-RedHat.txt @@ -458,6 +458,8 @@ and Mozilla. Other Sources of Documentation: ------------------------------- +/usr/share/doc/postfix-/README_FILES/SASL_README + Local configuration examples: /usr/share/doc/postfix-*/samples diff --git a/postfix-etc-init.d-postfix b/postfix-etc-init.d-postfix index 1cd66ef..4973f7a 100644 --- a/postfix-etc-init.d-postfix +++ b/postfix-etc-init.d-postfix @@ -16,23 +16,37 @@ # 20/01/01: Changes to fall in line with RedHat 7.0 style # 23/02/01: Fix a few untidy problems with help from Daniel Roesen. +### BEGIN INIT INFO +# Provides: postfix MTA +# Required-Start: $local_fs $network $remote_fs +# Required-Stop: $local_fs $network $remote_fs +# Short-Description: start and stop postfix +# Description: Postfix is a Mail Transport Agent, which is the program that +# moves mail from one machine to another. +### END INIT INFO + # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - -[ -x /usr/sbin/postfix ] || exit 0 -[ -d /etc/postfix ] || exit 0 -[ -d /var/spool/postfix ] || exit 0 - RETVAL=0 prog="postfix" +status master >/dev/null 2>&1 +running=$? + +conf_check() { + [ -x /usr/sbin/postfix ] || exit 5 + [ -d /etc/postfix ] || exit 6 + [ -d /var/spool/postfix ] || exit 5 +} + start() { + # Check that networking is up. + [ ${NETWORKING} = "no" ] && exit 1 + conf_check # Start daemons. echo -n $"Starting postfix: " /usr/bin/newaliases >/dev/null 2>&1 @@ -44,6 +58,7 @@ start() { } stop() { + conf_check # Stop daemons. echo -n $"Shutting down postfix: " /usr/sbin/postfix stop 2>/dev/null 1>&2 && success || failure $"$prog stop" @@ -54,6 +69,7 @@ stop() { } reload() { + conf_check echo -n $"Reloading postfix: " /usr/sbin/postfix reload 2>/dev/null 1>&2 && success || failure $"$prog reload" RETVAL=$? @@ -62,38 +78,39 @@ reload() { } abort() { + conf_check /usr/sbin/postfix abort 2>/dev/null 1>&2 && success || failure $"$prog abort" return $? } flush() { + conf_check /usr/sbin/postfix flush 2>/dev/null 1>&2 && success || failure $"$prog flush" return $? } check() { + conf_check /usr/sbin/postfix check 2>/dev/null 1>&2 && success || failure $"$prog check" return $? } -restart() { - stop - start -} - # See how we were called. case "$1" in start) + [ $running -eq 0 ] && exit 0 start ;; stop) + [ $running -eq 0 ] || exit 0 stop ;; - restart) + restart|force-reload) stop start ;; reload) + [ $running -eq 0 ] || exit 7 reload ;; abort) @@ -109,11 +126,13 @@ case "$1" in status master ;; condrestart) - [ -f /var/lock/subsys/postfix ] && restart || : + [ $running -eq 0 ] || exit 0 + stop + start ;; *) echo $"Usage: $0 {start|stop|restart|reload|abort|flush|check|status|condrestart}" - exit 1 + exit 2 esac exit $? diff --git a/postfix.spec b/postfix.spec index b571baf..b212da4 100644 --- a/postfix.spec +++ b/postfix.spec @@ -39,7 +39,7 @@ Name: postfix Summary: Postfix Mail Transport Agent Version: 2.4.5 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 2 Group: System Environment/Daemons URL: http://www.postfix.org @@ -466,6 +466,10 @@ exit 0 %changelog +* Thu Oct 4 2007 Thomas Woerner 2:2.4.5-2 +- made init script lsb conform (#243286, rhbz#247025) +- added link to postfix sasl readme into Postfix-SASL-RedHat readme + * Mon Aug 13 2007 Thomas Woerner 2:2.4.5-1 - new version 2.4.5 - fixed compile proplem with glibc-2.6.90+