summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard A Nelson (Rick) <cowboy@debian.org>2007-05-19 20:14:00 +0000
committerAndreas Beckmann <debian@abeckmann.de>2012-10-01 19:59:14 +0200
commitd6430271e61e46982620d351e0719280373717ab (patch)
treef288549f771173b84f4004df02647496c9e04d12
parentd9e109dbbaa9facd91857abf55a21c295908faf6 (diff)
downloadsendmail-d6430271e61e46982620d351e0719280373717ab.tar.gz
Imported Debian patch 8.14.1-3debian/8.14.1-3
-rw-r--r--debian/build/autoconf.mk6
-rw-r--r--debian/build/debian/control.m4.in22
-rw-r--r--debian/build/debian/sendmail-bin.postinst.in22
-rw-r--r--debian/build/debian/sendmail.init.d.in54
-rw-r--r--debian/changelog12
-rw-r--r--debian/configure12
-rw-r--r--debian/configure.ac6
-rw-r--r--debian/control22
-rw-r--r--debian/local/sendmail.in156
9 files changed, 190 insertions, 122 deletions
diff --git a/debian/build/autoconf.mk b/debian/build/autoconf.mk
index dabc449..dbb2331 100644
--- a/debian/build/autoconf.mk
+++ b/debian/build/autoconf.mk
@@ -2,9 +2,9 @@
#------------------------------------------------------------------------------
# vim: syntax=make
#
-# $Sendmail: autoconf.mk,v 8.14.1 2007-05-11 07:26:49 cowboy Exp $
+# $Sendmail: autoconf.mk,v 8.14.1 2007-05-21 16:46:55 cowboy Exp $
#
-# Copyright (c) 1998-2005 Richard Nelson. All Rights Reserved.
+# Copyright (c) 1998-2007 Richard Nelson. All Rights Reserved.
#
# build/autoconf.mk. Generated from autoconf.mk.in by configure.
#
@@ -16,7 +16,7 @@
# on Debian slink, potato, woody, testing, sid, ...
# but the generated file is customized to the version noted above.
#
-# Richard Nelson <cowboy@debian.org> 2007-05-11 07:26:49 (-0700)
+# Richard Nelson <cowboy@debian.org> 2007-05-21 16:46:55 (-0700)
#------------------------------------------------------------------------------
#SHELL := /bin/sh -x
diff --git a/debian/build/debian/control.m4.in b/debian/build/debian/control.m4.in
index 605c3e4..6fd5782 100644
--- a/debian/build/debian/control.m4.in
+++ b/debian/build/debian/control.m4.in
@@ -22,9 +22,9 @@ dnl #
Priority: extra
Section: mail
Maintainer: Richard A Nelson (Rick) <cowboy@debian.org>
-Standards-Version: 3.6.10.0
+Standards-Version: 3.7.2
Build-Depends-Indep: groff, bsdmainutils
-Build-Depends: make (>> 3.79.1-14), m4, patch, debhelper (>= 4.1.68) @sm_badepends@
+Build-Depends: make (>> 3.79.1-14), m4, patch, debhelper (>= 4.1.68), linux-kernel-headers @sm_badepends@
Build-Conflicts: libbind-dev, bind-dev, fakeroot (<< 0.4.5)]]dnl
dnl #
dnl # The arch=any package: sendmail-bin
@@ -37,7 +37,7 @@ Architecture: any
Section: mail
Replaces: mail-transport-agent
Provides: mail-transport-agent
-Conflicts: mail-transport-agent, sendmail (<< 8.13.1-7)
+Conflicts: mail-transport-agent
Depends: sendmail-base, sendmail-cf, ${shlibs:Depends}, ${perl:Depends} @sm_depends@
Recommends: @sm_recommends@
Suggests: sendmail-doc, @sm_suggests@, cyrus-common
@@ -87,7 +87,6 @@ dnl #
Package: sensible-mda
Architecture: any
Section: mail
-Conflicts: sendmail (<< 8.13.1-7)
Depends: sendmail-bin | mail-transport-agent, procmail | maildrop | deliver, ${shlibs:Depends}
Description: Mail Delivery Agent wrapper
Sensible-mda is a Debian addition in the sendmail package and has been
@@ -106,7 +105,6 @@ Package: libmilter@sm_libmilter_version@
Architecture: any
Section: libs
Depends: ${shlibs:Depends}
-Conflicts: libmilter-dev (<= 8.13.3-0)
Description: Sendmail Mail Filter API (Milter)
The Sendmail Mail Filter API (Milter) is designed to allow third-party
programs access to mail messages as they are being processed in order
@@ -121,8 +119,7 @@ Description: Sendmail Mail Filter API (Milter)
Package: libmilter@sm_libmilter_version@-dbg
Architecture: any
Section: libs
-Depends: ${shlibs:Depends}
-Conflicts: libmilter-dev (<= 8.13.3-0)
+Depends: libmilter@sm_libmilter_version@ (= ${binary:Version}), ${shlibs:Depends}
Description: Sendmail Mail Filter API (Milter)
The Sendmail Mail Filter API (Milter) is designed to allow third-party
programs access to mail messages as they are being processed in order
@@ -142,7 +139,7 @@ ifelse([[@sm_enable_dev@]], [[yes]], [[[[
Package: libmilter-dev
Architecture: any
Section: libdevel
-Depends: libmilter@sm_libmilter_version@ (= ${Source-Version})
+Depends: libmilter@sm_libmilter_version@ (= ${binary:Version})
Suggests: sendmail-doc
Description: Sendmail Mail Filter API (Milter)
The Sendmail Mail Filter API (Milter) is designed to allow third-party
@@ -192,8 +189,8 @@ Package: sendmail
Architecture: all
Section: mail
Replaces: sendmail-tls
-Depends: sendmail-base (= ${Source-Version}), sendmail-bin (= ${Source-Version}), sendmail-cf (= ${Source-Version}), sensible-mda (= ${Source-Version}), rmail (= ${Source-Version})
-Suggests: sendmail-doc
+Depends: sendmail-base, sendmail-bin, sendmail-cf, sensible-mda
+Suggests: sendmail-doc, rmail
Description: powerful, efficient, and scalable Mail Transport Agent
Sendmail is an alternative Mail Transport Agent (MTA) for Debian.
It is suitable for handling sophisticated mail configurations,
@@ -224,9 +221,7 @@ Package: sendmail-base
Architecture: all
Section: mail
Depends: update-inetd, m4, make, adduser, netbase (>= 4.08), ${perl:Depends}
-Recommends: resolvconf
-Suggests: sendmail-doc, ca-certificates, logcheck, logrotate
-Conflicts: sendmail (<= 8.13.1-7)
+Suggests: sendmail-doc, ca-certificates, logcheck, logrotate, resolvconf
Description: powerful, efficient, and scalable Mail Transport Agent
Sendmail is an alternative Mail Transport Agent (MTA) for
Debian. It is suitable for handling sophisticated mail
@@ -247,7 +242,6 @@ Package: sendmail-cf
Architecture: all
Section: mail
Suggests: sendmail-doc, m4
-Conflicts: sendmail (<< 8.13.1-7)
Description: powerful, efficient, and scalable Mail Transport Agent
Sendmail is an alternative Mail Transport Agent (MTA) for
Debian. It is suitable for handling sophisticated mail
diff --git a/debian/build/debian/sendmail-bin.postinst.in b/debian/build/debian/sendmail-bin.postinst.in
index 6305757..13ce727 100644
--- a/debian/build/debian/sendmail-bin.postinst.in
+++ b/debian/build/debian/sendmail-bin.postinst.in
@@ -30,7 +30,7 @@ PACKAGE=sendmail-bin;
#-----------------------------------------------------------
#stop(): stop sendmail
-stop () {
+stop_mta () {
# Account for varying PIDfile locations of older sendmail packages
if [ -f /var/run/sendmail/mta/sendmail.pid ]; then
start-stop-daemon --stop --oknodo --quiet \
@@ -62,7 +62,7 @@ stop () {
#-----------------------------------------------------------
#start(): start sendmail
-start () {
+start_mta () {
if [ -x /usr/sbin/invoke-rc.d ]; then
/usr/sbin/invoke-rc.d sendmail start;
else
@@ -72,7 +72,7 @@ start () {
#-----------------------------------------------------------
# configure(): save sendmail.cf, call sendmailconfig
-configure () {
+configure_mta () {
local enter;
echo -n "Configure now ? (y/N) ";
read yn;
@@ -80,9 +80,9 @@ configure () {
test -n "$yn" || yn="N";
case "$yn" in
[Yy]*)
- stop;
+ stop_mta;
@sbindir@/sendmailconfig --no-reload;
- start;
+ start_mta;
;;
[Nn]*)
@@ -210,10 +210,10 @@ if [ ! -f @sysconfdir@/mail/sendmail.mc ]; then
fi;
if [ -x @datadir@/sendmail/update_sendmail ]; then
- stop;
+ stop_mta;
echo "Updating sendmail environment ...";
@datadir@/sendmail/update_sendmail || true;
- start;
+ start_mta;
fi;
exit 0;
@@ -251,7 +251,7 @@ case "$yn" in
chmod 0644 @sysconfdir@/mail/submit.cf.old;
fi;
if [ -x @datadir@/sendmail/update_sendmail ]; then
- stop;
+ stop_mta;
echo "Updating sendmail environment ...";
@datadir@/sendmail/update_sendmail || true;
fi;
@@ -286,7 +286,7 @@ case "$yn" in
EOT
echo "Do you wish to run sendmailconfig now, or later";
start_ask=0;
- configure;
+ configure_mta;
case "$yn" in
[Yy]*)
cat <<-EOT
@@ -296,7 +296,7 @@ case "$yn" in
from your older sendmail.cf.old?
EOT
start_ask=1;
- start;
+ start_mta;
;;
esac;
exit 0;
@@ -307,7 +307,7 @@ case "$yn" in
# Now, liberal application of smoke and mirrors
if [ -f @sysconfdir@/mail/sendmail.mc ]; then
start_ask=1;
- start;
+ start_mta;
fi;
exit 0;
diff --git a/debian/build/debian/sendmail.init.d.in b/debian/build/debian/sendmail.init.d.in
index 060643f..f5126b2 100644
--- a/debian/build/debian/sendmail.init.d.in
+++ b/debian/build/debian/sendmail.init.d.in
@@ -1,19 +1,39 @@
-#!/bin/sh -e
-#
-# $Sendmail: init.d,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
-#
-# Sendmail rc script for Debian (/etc/init.d/sendmail)
-# all the work is done by the imbedded copy of /usr/share/sendmail/sendmail
-#
-# Copyright (c) 2001-@SM_CPYRT@, Richard Nelson <cowboy@debian.org>.
-#
-# Notes (to all):
-# * *** Do not edit this file *** Instead edit /etc/mail/sendmail.conf
-#
-# Notes (to self):
-# *
-#
-set -e;
-PATH=/bin:/usr/bin:/sbin:/usr/sbin;
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: sendmail
+# Required-Start: $local_fs $network
+# Required-Stop: $local_fs $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: powerful, efficient, and scalable Mail Transport Agent
+# Description: Sendmail is an alternative Mail Transport Agent (MTA)
+# for Debian. It is suitable for handling sophisticated
+# mail configurations, although this means that its
+# configuration can also be complex. Fortunately, simple
+# thing can be done easily, and complex thing are possible,
+# even if not easily understood ;) Sendmail is the *ONLY*
+# MTA with a Turing complete language to control *ALL*
+# aspects of delivery!
+### END INIT INFO
+# Author: Marc-Christian Petersen <m.c.p@kernel.linux-systeme.com>
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+DESC="Mail Transport Agent (MTA)"
+NAME=sendmail
+DAEMON=/usr/sbin/$NAME
+DAEMON_ARGS=""
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/sendmail ] && . /etc/default/sendmail
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+. /lib/lsb/init-functions
diff --git a/debian/changelog b/debian/changelog
index 623d482..14b27bf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+sendmail (8.14.1-3) unstable; urgency=low
+
+ * Add missing build-depends for linux-kernel-headers
+ Thanks Marc-Christian Petersen
+ * LSB init scripts
+ Thanks Marc-Christian Petersen
+ * Finally, make rmail a suggestion, not a dependancy
+ and remove conflicts with old versions closes: #376113
+ * Suffix _mta to start/stop/configure for ksh closes: #424213
+
+ -- Richard A Nelson (Rick) <cowboy@debian.org> Thu, 19 May 2007 20:14:00 -0000
+
sendmail (8.14.1-2) unstable; urgency=high
* Rebuild against a fixed libd4.5 closes: #423153
diff --git a/debian/configure b/debian/configure
index 33ae5d3..89efc07 100644
--- a/debian/configure
+++ b/debian/configure
@@ -7,11 +7,11 @@
#
# #
# # $Sendmail$
-# # from Sendmail: ./configure.ac,v 8.14.1 2007-04-03 21:00:00
+# # from Sendmail: ./configure.ac,v 8.14.1 2007-05-21 20:45:00
# #
# cat <<EOF
#
-# Copyright (c) 1998-2005 Richard Nelson. All Rights Reserved.
+# Copyright (c) 1998-2007 Richard Nelson. All Rights Reserved.
#
# Sendmail 8.14.1
# Generated by Autoconf 2.61, Automake _am_version
@@ -1538,11 +1538,11 @@ gives unlimited permission to copy, distribute and modify it.
#
# $Sendmail$
-# from Sendmail: ./configure.ac,v 8.14.1 2007-04-03 21:00:00
+# from Sendmail: ./configure.ac,v 8.14.1 2007-05-21 20:45:00
#
cat <<EOF
- Copyright (c) 1998-2005 Richard Nelson. All Rights Reserved.
+ Copyright (c) 1998-2007 Richard Nelson. All Rights Reserved.
Sendmail 8.14.1
Generated by Autoconf 2.61, Automake _am_version
@@ -2552,10 +2552,10 @@ am_version="$am__api_version";
SM_VERS='8.14.1';
-SM_DATE='2007-04-03 21:00:00';
+SM_DATE='2007-05-21 20:45:00';
SM_MINVERS='8.7.6';
SM_MAXVERS='9.0.0';
-SM_CPYRT='2005';
+SM_CPYRT='2007';
diff --git a/debian/configure.ac b/debian/configure.ac
index 374b59b..34704b2 100644
--- a/debian/configure.ac
+++ b/debian/configure.ac
@@ -2,7 +2,7 @@
#
# $Sendmail: ./configure.ac,v 8.14.1 2007/04/03 21:00:00 cowboy Exp $
#
-# Copyright (c) 1998-2006 Richard Nelson. All Rights Reserved.
+# Copyright (c) 1998-2007 Richard Nelson. All Rights Reserved.
#
# Debian configure file for building Sendmail
# Note: this file supports Sendmail 8.7.6 - 8.14.1
@@ -12,9 +12,9 @@
# ac_init portion are dual-pathed to better support 2.50+
#
#------------------------------------------------------------------------------
-define([_SM_CPYRT], [2005])dnl
+define([_SM_CPYRT], [2007])dnl
define([_SM_VERS], [8.14.1])dnl
-define([_SM_DATE], [2007-04-03 21:00:00])dnl
+define([_SM_DATE], [2007-05-21 20:45:00])dnl
define([_SM_MAXVERS],[9.0.0])dnl
define([_SM_MINVERS],[8.7.6])dnl
diff --git a/debian/control b/debian/control
index 23fcd71..81778eb 100644
--- a/debian/control
+++ b/debian/control
@@ -2,9 +2,9 @@ Source: sendmail
Priority: extra
Section: mail
Maintainer: Richard A Nelson (Rick) <cowboy@debian.org>
-Standards-Version: 3.6.10.0
+Standards-Version: 3.7.2
Build-Depends-Indep: groff, bsdmainutils
-Build-Depends: make (>> 3.79.1-14), m4, patch, debhelper (>= 4.1.68) , libdb4.5-dev, libldap2-dev, libwrap0-dev, liblockfile-dev, libsasl2-dev, libssl-dev
+Build-Depends: make (>> 3.79.1-14), m4, patch, debhelper (>= 4.1.68), linux-kernel-headers , libdb4.5-dev, libldap2-dev, libwrap0-dev, liblockfile-dev, libsasl2-dev, libssl-dev
Build-Conflicts: libbind-dev, bind-dev, fakeroot (<< 0.4.5)
Package: sendmail-bin
@@ -12,7 +12,7 @@ Architecture: any
Section: mail
Replaces: mail-transport-agent
Provides: mail-transport-agent
-Conflicts: mail-transport-agent, sendmail (<< 8.13.1-7)
+Conflicts: mail-transport-agent
Depends: sendmail-base, sendmail-cf, ${shlibs:Depends}, ${perl:Depends}
Recommends:
Suggests: sendmail-doc, , sasl2-bin, libsasl2-modules | libsasl2-modules-plain | libsasl2-digestmd5-plain | libsasl2-digestmd5-des, openssl, cyrus-common
@@ -52,7 +52,6 @@ Description: MTA->UUCP remote mail handler
Package: sensible-mda
Architecture: any
Section: mail
-Conflicts: sendmail (<< 8.13.1-7)
Depends: sendmail-bin | mail-transport-agent, procmail | maildrop | deliver, ${shlibs:Depends}
Description: Mail Delivery Agent wrapper
Sensible-mda is a Debian addition in the sendmail package and has been
@@ -66,7 +65,6 @@ Package: libmilter1
Architecture: any
Section: libs
Depends: ${shlibs:Depends}
-Conflicts: libmilter-dev (<= 8.13.3-0)
Description: Sendmail Mail Filter API (Milter)
The Sendmail Mail Filter API (Milter) is designed to allow third-party
programs access to mail messages as they are being processed in order
@@ -81,8 +79,7 @@ Description: Sendmail Mail Filter API (Milter)
Package: libmilter1-dbg
Architecture: any
Section: libs
-Depends: ${shlibs:Depends}
-Conflicts: libmilter-dev (<= 8.13.3-0)
+Depends: libmilter1 (= ${binary:Version}), ${shlibs:Depends}
Description: Sendmail Mail Filter API (Milter)
The Sendmail Mail Filter API (Milter) is designed to allow third-party
programs access to mail messages as they are being processed in order
@@ -97,7 +94,7 @@ Description: Sendmail Mail Filter API (Milter)
Package: libmilter-dev
Architecture: any
Section: libdevel
-Depends: libmilter1 (= ${Source-Version})
+Depends: libmilter1 (= ${binary:Version})
Suggests: sendmail-doc
Description: Sendmail Mail Filter API (Milter)
The Sendmail Mail Filter API (Milter) is designed to allow third-party
@@ -137,8 +134,8 @@ Package: sendmail
Architecture: all
Section: mail
Replaces: sendmail-tls
-Depends: sendmail-base (= ${Source-Version}), sendmail-bin (= ${Source-Version}), sendmail-cf (= ${Source-Version}), sensible-mda (= ${Source-Version}), rmail (= ${Source-Version})
-Suggests: sendmail-doc
+Depends: sendmail-base, sendmail-bin, sendmail-cf, sensible-mda
+Suggests: sendmail-doc, rmail
Description: powerful, efficient, and scalable Mail Transport Agent
Sendmail is an alternative Mail Transport Agent (MTA) for Debian.
It is suitable for handling sophisticated mail configurations,
@@ -164,9 +161,7 @@ Package: sendmail-base
Architecture: all
Section: mail
Depends: update-inetd, m4, make, adduser, netbase (>= 4.08), ${perl:Depends}
-Recommends: resolvconf
-Suggests: sendmail-doc, ca-certificates, logcheck, logrotate
-Conflicts: sendmail (<= 8.13.1-7)
+Suggests: sendmail-doc, ca-certificates, logcheck, logrotate, resolvconf
Description: powerful, efficient, and scalable Mail Transport Agent
Sendmail is an alternative Mail Transport Agent (MTA) for
Debian. It is suitable for handling sophisticated mail
@@ -182,7 +177,6 @@ Package: sendmail-cf
Architecture: all
Section: mail
Suggests: sendmail-doc, m4
-Conflicts: sendmail (<< 8.13.1-7)
Description: powerful, efficient, and scalable Mail Transport Agent
Sendmail is an alternative Mail Transport Agent (MTA) for
Debian. It is suitable for handling sophisticated mail
diff --git a/debian/local/sendmail.in b/debian/local/sendmail.in
index deb4105..33eb7b8 100644
--- a/debian/local/sendmail.in
+++ b/debian/local/sendmail.in
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/sh
#-----------------------------------------------------------------------------
# $Sendmail: sm_helper.sh,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
#
@@ -18,13 +18,26 @@
set -e;
DEBUG=0;
-# LSB compliance (kinda)
-if [ -f /lib/lsb/init-functions ]; then
- . /lib/lsb/init-functions;
-else
- log_begin_msg() { echo "$@"; };
- log_success_msg() { echo "$@"; };
- log_warning_msg() { echo "$@"; };
+# Support stand-alone execution
+if [ -z "$DAEMON" ]; then
+ PATH=/bin:/usr/bin:/sbin:/usr/sbin
+ DESC="Mail Transport Agent (MTA)"
+ NAME=sendmail
+ DAEMON=/usr/sbin/$NAME
+ DAEMON_ARGS=""
+ SCRIPTNAME=/etc/init.d/$NAME
+
+ # Exit if the package is not installed
+ [ -x "$DAEMON" ] || exit 0
+
+ # Read configuration variable file if it is present
+ [ -r /etc/default/sendmail ] && . /etc/default/sendmail
+
+ # Load the VERBOSE setting and other rcS variables
+ . /lib/init/vars.sh
+
+ # Define LSB log_* functions.
+ . /lib/lsb/init-functions
fi;
#------------------------------------------------------------------------------
@@ -168,6 +181,8 @@ Get_Parameters () {
# enhanced sendmail startup
#------------------------------------------------------------------------------
start_mta () {
+ local result;
+ result=0;
#
# Make sure @localstatedir@/run/sendmail/ exists
check_dirs;
@@ -175,11 +190,14 @@ start_mta () {
# If already running, don't start it...
if is_running mta; then
log_warning_msg 'MTA is already running.';
- return;
+ return 1;
fi;
#
# Check if we're going to run a daemon (and how many):
- daemon_check;
+ daemon_check || result=$?;
+ if [ "$result" -ne 0 ]; then
+ return $result;
+ fi;
#
# Mark restarted for communication betwixt here and /etc/mail/Makefile
touch $STAMP_DIR/reload;
@@ -214,7 +232,7 @@ start_mta () {
if [ "$LOG_CMDS" = "Yes" ]; then
logger -i -p mail.debug -- "$0 $CMD";
fi;
- $CMD &
+ $CMD &
sleep 2;
qp=`expr "${MTAQ_PARMS}" : '.*\(-qp[0-9]*[smhdw]\)'` || true;
if [ -z "$qp" ]; then
@@ -236,9 +254,12 @@ start_mta () {
if check_msp; then
$MSP_COMMAND -q $MSP_A $MSP_L_QUEUE $MSP_PARMS $MISC_PARMS;
fi;
+ return $result;
};
start_msp () {
+ local result;
+ result=0;
#
# Make sure @localstatedir@/run/sendmail/ exists
check_dirs;
@@ -246,17 +267,17 @@ start_msp () {
# If already running, don't start it...
if is_running msp; then
log_warning_msg 'MSP is already running.';
- return;
+ return 1;
fi;
#
# Check to see if MSP mode is indeed available
if ! check_msp; then
- return;
+ return 0;
fi;
#
# Check if we're going to run a daemon:
if [ "$MSP_MODE" != 'daemon' ]; then
- return;
+ return 0;
fi;
#
# We can only afford to clean the MSP queues if running daemon mode,
@@ -268,13 +289,17 @@ start_msp () {
cd $MSP_ROOT;
$START_MSP_CMD -- \
$MSP_A $MSP_L -q${MSP_INTERVAL} $MSP_PARMS $MISC_PARMS &
+ return $result;
};
start_sendmail () {
- start_mta;
+ local result;
+ result=0;
+ start_mta || result=$?;
if check_msp; then
- start_msp;
+ start_msp || true;
fi;
+ return $result;
};
#------------------------------------------------------------------------------
@@ -283,6 +308,8 @@ start_sendmail () {
# enhanced sendmail reload
#------------------------------------------------------------------------------
reload_mta () {
+ local result;
+ result=0;
#
# Make sure @localstatedir@/run/sendmail/ exists
check_dirs;
@@ -298,7 +325,7 @@ reload_mta () {
fi;
#
# Is running, must signal it...
- $SIGNAL_MTAL_CMD --signal HUP --oknodo --quiet || true;
+ $SIGNAL_MTAL_CMD --signal HUP --oknodo --quiet || result=$?;
sleep 2;
chown $DAEMON_UID:smmta $MTAL_SOCKET;
chmod 0666 $MTAL_SOCKET;
@@ -307,9 +334,12 @@ reload_mta () {
if [ "$SPLIT_DAEMON" -eq 1 ]; then
$SIGNAL_MTAQ_CMD --signal HUP --oknodo --quiet || true;
fi;
+ return $result;
};
reload_msp () {
+ local result;
+ result=0;
#
# Make sure @localstatedir@/run/sendmail/ exists
check_dirs;
@@ -322,14 +352,18 @@ reload_msp () {
fi;
#
# Is running, must signal it...
- $SIGNAL_MSP_CMD --signal HUP --oknodo --quiet || true;
+ $SIGNAL_MSP_CMD --signal HUP --oknodo --quiet || result=$?;
+ return $result;
};
reload_sendmail () {
- reload_mta;
+ local result;
+ result=0;
+ reload_mta || result=$?;
if check_msp; then
- reload_msp;
+ reload_msp || true;
fi;
+ return $result;
};
#------------------------------------------------------------------------------
@@ -338,7 +372,8 @@ reload_sendmail () {
# enhanced sendmail shutdown
#------------------------------------------------------------------------------
stop_mta () {
- local cnt;
+ local result cnt;
+ result=0;
stopped=0;
#
# Make sure @localstatedir@/run/sendmail/ exists
@@ -346,41 +381,44 @@ stop_mta () {
#
# If not running, don't stop it...
if ! is_running mta; then
- return;
+ return 0;
fi;
#
# Is running, must stop it...
$STOP_MTAL_CMD --signal TERM --quiet --oknodo > /dev/null;
#
- # Now we have to wait until sendmail has _really_ stopped.
+ # Now we have to wait until sendmail has _really_ stopped.
#
sleep 2;
if $STOP_MTAL_CMD --signal TERM --quiet > /dev/null; then
- echo -n ' Waiting .';
+ log_progress_msg ' Waiting .';
cnt=0;
while $STOP_MTAL_CMD --signal TERM --quiet > /dev/null; do
cnt=`expr $cnt + 1`;
if [ $cnt -gt 60 ]; then
#
- # Waited 120 seconds now. Fail.
+ # Waited 120 seconds now. Fail.
#
echo -n ' Failed ';
stopped=1;
break;
fi;
sleep 2;
- echo -n '.';
+ log_progress_msg '.';
done;
echo -n ' Done ';
fi;
+ #
# Remove pidfile iff stopped
if ! $STOP_MTAL_CMD --signal TERM --quiet > /dev/null; then
rm -f "$MTAL_PIDFILE";
fi
+ return $result;
};
stop_queue () {
- local cnt;
+ local result cnt;
+ result=0;
stopped=0;
#
# Make sure @localstatedir@/run/sendmail/ exists
@@ -388,41 +426,44 @@ stop_queue () {
#
# If not running, don't stop it...
if ! is_running queue; then
- return;
+ return 0;
fi;
#
# Is running, must stop it...
$STOP_MTAQ_CMD --signal TERM --quiet --oknodo > /dev/null;
#
- # Now we have to wait until sendmail has _really_ stopped.
+ # Now we have to wait until sendmail has _really_ stopped.
#
sleep 2;
if $STOP_MTAQ_CMD --signal TERM --quiet > /dev/null; then
- echo -n ' Waiting .';
+ log_progress_msg ' Waiting .';
cnt=0;
while $STOP_MTAQ_CMD --signal TERM --quiet > /dev/null; do
cnt=`expr $cnt + 1`;
if [ $cnt -gt 60 ]; then
#
- # Waited 120 seconds now. Fail.
+ # Waited 120 seconds now. Fail.
#
echo -n ' Failed ';
stopped=1;
break;
fi;
sleep 2;
- echo -n '.';
+ log_progress_msg '.';
done;
echo -n ' Done ';
fi;
+ #
# Remove pidfile iff stopped
if ! $STOP_MTAQ_CMD --signal TERM --quiet > /dev/null; then
rm -f "$MTAQ_PIDFILE";
fi
+ return $result;
};
stop_msp () {
- local cnt;
+ local result cnt;
+ result=0;
stopped=0;
#
# Make sure @localstatedir@/run/sendmail/ exists
@@ -430,7 +471,7 @@ stop_msp () {
#
# If not running, don't stop it...
if ! is_running msp; then
- return;
+ return 0;
fi;
#
# Is running, must stop it...
@@ -440,7 +481,7 @@ stop_msp () {
#
sleep 2;
if $STOP_MSP_CMD --signal TERM --quiet > /dev/null; then
- echo -n 'Waiting .';
+ log_progress_msg 'Waiting .';
cnt=0;
while $STOP_MSP_CMD --signal TERM --quiet > /dev/null; do
cnt=`expr $cnt + 1`;
@@ -453,22 +494,27 @@ stop_msp () {
break;
fi;
sleep 2;
- echo -n '.';
+ log_progress_msg '.';
done;
echo -n ' Done ';
fi;
+ #
# Remove pidfile iff stopped
if ! $STOP_MSP_CMD --signal TERM --quiet > /dev/null; then
rm -f "$MSP_PIDFILE";
fi;
+ return $result;
};
stop_sendmail () {
+ local result;
+ result=0;
if check_msp; then
- stop_msp;
+ stop_msp || true;
fi;
- stop_mta;
- stop_queue;
+ stop_mta || result=$?;
+ stop_queue || true;
+ return $result;
};
#------------------------------------------------------------------------------
@@ -601,7 +647,7 @@ mailstats () {
Get_Parameters;
fi;
#
- #if running split service, show the client status first
+ # if running split service, show the client status first
if check_msp; then
echo 'MSP statistics...';
#check if we have a status file for the MSP
@@ -613,7 +659,8 @@ mailstats () {
fi;
echo 'MTA statistics...';
fi;
- #check if we have a status file for the MTA
+ #
+ # check if we have a status file for the MTA
statusfile=$(grep -Ee '^O StatusFile=/.*' \
@sysconfdir@/mail/sendmail.cf | cut -d= -f2);
if [ -n $statusfile ]; then
@@ -849,9 +896,8 @@ daemon_check () {
# * DAEMON_MODE = (none | inet) & QUEUE_MODE = (none | cron)
if [ ! -s @sysconfdir@/mail/sendmail.cf ] || \
[ ! -s @sysconfdir@/mail/sendmail.mc ]; then
- echo 'sendmail has not been configured, not started.';
- echo 'To configure sendmail, type sendmailconfig';
- exit 1;
+ log_failure_msg 'Not configured, not started.';
+ return 1;
fi;
MTAL_PARMS="$MTA_A $MTAL_L";
@@ -902,9 +948,10 @@ daemon_check () {
MTAQ_PARMS="$MTAQ_PARMS -O ControlSocketName=$MTAQ_CNTL";
if [ $run_daemon -lt 2 ]; then
- echo 'sendmail listen/queue daemon not desired.';
- exit 0;
+ log_failure_msg 'listen/queue daemon not needed.';
+ return 1;
fi;
+ return 0;
};
#------------------------------------------------------------------------------
@@ -1051,6 +1098,7 @@ case $(basename $0) in
exit $?
;;
*)
+ : # Fall through and handle below
;;
esac;
@@ -1064,25 +1112,25 @@ case "$1" in
# Debian required/optional targets:
#-----------------------------------------------------------------------
start)
- echo -n 'Starting Mail Transport Agent: sendmail';
+ log_daemon_msg "Starting $DESC" "$NAME";
start_sendmail;
- echo '.'
+ log_end_msg $?;
;;
stop|force-stop)
- echo -n 'Stopping Mail Transport Agent: sendmail';
+ log_daemon_msg "Stopping $DESC" "$NAME";
stop_sendmail;
- echo '.'
+ log_end_msg $?;
;;
restart)
- echo -n 'Restarting Transport Agent: sendmail';
+ log_daemon_msg "Restarting $DESC" "$NAME";
# reload is equivalent (but faster) than stop/start !
# but... it doesn't honor changes to /etc/mail/sendmail.conf
#reload_sendmail;
stop_sendmail;
start_sendmail;
- echo '.';
+ log_end_msg $?;
;;
restart-if-running)
@@ -1102,9 +1150,9 @@ case "$1" in
;;
reload|force-reload)
- echo -n 'Reloading Mail Transport Agent configuration: sendmail';
+ log_daemon_msg "Reloading $DESC" "$NAME";
reload_sendmail;
- echo '.';
+ log_end_msg $?;
;;
#-----------------------------------------------------------------------