Package: courier
Version: 0.53.2-3
Severity: minor
Tags: patch
Hi,
the attached patch adds lsb logging output to all the init scripts used
by the different courier daemons.
Regards,
David
diff -Nur courier-0.53.2.orig/debian/control courier-0.53.2/debian/control
--- courier-0.53.2.orig/debian/control 2006-08-27 11:50:37.000000000 +0200
+++ courier-0.53.2/debian/control 2006-08-27 13:59:53.000000000 +0200
@@ -8,7 +8,7 @@
Package: courier-base
Architecture: any
-Depends: ${shlibs:Depends}, ${perl:Depends}, debconf (>= 0.5.00) |
debconf-2.0, courier-authlib, courier-authlib-userdb, courier-authdaemon
+Depends: ${shlibs:Depends}, ${perl:Depends}, debconf (>= 0.5.00) |
debconf-2.0, courier-authlib, courier-authlib-userdb, courier-authdaemon,
lsb-base (>= 3.0-10)
Replaces: courier-debug (<< 0.44.2)
Conflicts: courier-imap (<= 1.3.3), courier-debug (<< 0.44.2), sqwebmail (<<
0.45.6)
Description: Courier Mail Server - Base system
diff -Nur courier-0.53.2.orig/debian/courier-imap.init
courier-0.53.2/debian/courier-imap.init
--- courier-0.53.2.orig/debian/courier-imap.init 2006-08-27
11:50:37.000000000 +0200
+++ courier-0.53.2/debian/courier-imap.init 2006-08-27 13:21:07.000000000
+0200
@@ -11,19 +11,21 @@
PROGRAM="Courier IMAP server"
SSLCONFIG=
+. /lib/lsb/init-functions
+
# first of all check if daemon is available
if ! [ -x "${bindir}/imapd" ]; then
exit 0
fi
if ! [ -x $TCPD ]; then
- echo "ERR: $TCPD missing"
- exit 1
+ log_action_msg "$PROGRAM: ERROR - $TCPD missing"
+ exit 1
fi
if ! [ -f ${sysconfdir}/$DAEMON ]; then
- echo "ERR: config file missing"
- exit 1
+ log_action_msg "$PROGRAM: ERROR - config file missing"
+ exit 1
fi
# read/set defaults
@@ -45,14 +47,16 @@
[yY]*)START=yes;;
esac
+if [ "$START" = "no" ]; then
+ exit 0
+fi
+
case "$1" in
start)
- if [ "$START" = "yes" ]; then
- echo -n "Starting $PROGRAM:"
-
+ log_daemon_msg "Starting $PROGRAM" "$DAEMON"
umask $IMAP_UMASK
- ulimit -v $IMAP_ULIMITD
- /usr/bin/env - /bin/sh -c " set -a; \
+ ulimit -v $IMAP_ULIMITD
+ /usr/bin/env - /bin/sh -c " set -a; \
bindir=${bindir}; \
. ${sysconfdir}/imapd; \
if [ "$SSLCONFIG" ]; then . ${sysconfdir}/imapd-ssl; fi; \
@@ -64,22 +68,21 @@
-maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \
$TCPDOPTS \
$PORT ${libexecdir}/courier/imaplogin \
- ${bindir}/imapd $MAILDIR"
- echo " $DAEMON."
- fi
+ ${bindir}/imapd $MAILDIR"
+ log_end_msg 0
;;
stop)
- echo -n "Stopping $PROGRAM:"
- /usr/sbin/courierlogger -pid=$PIDFILE -stop
- echo " $DAEMON."
+ log_daemon_msg "Stopping $PROGRAM" "$DAEMON"
+ /usr/sbin/courierlogger -pid=$PIDFILE -stop
+ log_end_msg 0
;;
restart | reload | force-reload)
- $0 stop
- $0 start
+ $0 stop
+ $0 start
;;
*)
- echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
- exit 1
- ;;
+ echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
+ exit 2
+ ;;
esac
exit 0
diff -Nur courier-0.53.2.orig/debian/courier-imap-ssl.init
courier-0.53.2/debian/courier-imap-ssl.init
--- courier-0.53.2.orig/debian/courier-imap-ssl.init 2006-08-27
11:50:37.000000000 +0200
+++ courier-0.53.2/debian/courier-imap-ssl.init 2006-08-27 12:32:46.000000000
+0200
@@ -11,20 +11,23 @@
DAEMON=imapd-ssl
PROGRAM="Courier IMAP-SSL server"
+. /lib/lsb/init-functions
+
test -f $DAEMONPROG || exit 0
if ! [ -x $TCPD ]; then
- echo "ERR: $TCPD missing"
- exit 1
+ log_action_msg "$PROGRAM: ERROR - $TCPD missing"
+ exit 1
fi
if ! [ -f ${sysconfdir}/imapd ]; then
- echo "ERR: config file missing"
- exit 1
+ log_action_msg "$PROGRAM: ERROR - config file missing"
+ exit 1
fi
+
if ! [ -f ${sysconfdir}/imapd-ssl ]; then
- echo "ERR: config file missing"
- exit 1
+ log_action_msg "$PROGRAM: ERROR - config file missing"
+ exit 1
fi
# read/set defaults
@@ -39,8 +42,8 @@
. ${sysconfdir}/imapd-ssl
if ! [ -x $COURIERTLS ]; then
- echo "ERR: $COURIERTLS missing"
- exit 1
+ log_action_msg "$PROGRAM: ERROR - $COURIERTLS missing"
+ exit 1
fi
START=no
@@ -54,10 +57,10 @@
case "$1" in
start)
- echo -n "Starting $PROGRAM:"
+ log_daemon_msg "Starting $PROGRAM" "$DAEMON"
umask $IMAP_UMASK
- ulimit -d $IMAP_ULIMITD
- /usr/bin/env - /bin/sh -c " . ${sysconfdir}/imapd ; \
+ ulimit -d $IMAP_ULIMITD
+ /usr/bin/env - /bin/sh -c " . ${sysconfdir}/imapd ; \
. ${sysconfdir}/imapd-ssl ; \
IMAP_TLS=1 ; export IMAP_TLS ; \
`sed -n '/^#/d;/=/p' <${sysconfdir}/imapd | \
@@ -72,20 +75,20 @@
$SSLPORT $COURIERTLS -server -tcpd \
${libexecdir}/courier/imaplogin \
${bindir}/imapd $MAILDIR"
- echo " $DAEMON."
+ log_end_msg 0
;;
stop)
- echo -n "Stopping $PROGRAM:"
- /usr/sbin/courierlogger -pid=$SSLPIDFILE -stop
- echo " $DAEMON."
+ log_daemon_msg "Stopping $PROGRAM" "$DAEMON"
+ /usr/sbin/courierlogger -pid=$SSLPIDFILE -stop
+ log_end_msg 0
;;
restart | reload | force-reload)
- $0 stop
- $0 start
+ $0 stop
+ $0 start
;;
*)
- echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
- exit 1
- ;;
+ echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
+ exit 2
+ ;;
esac
exit 0
diff -Nur courier-0.53.2.orig/debian/courier-ldap.init
courier-0.53.2/debian/courier-ldap.init
--- courier-0.53.2.orig/debian/courier-ldap.init 2006-08-27
11:50:37.000000000 +0200
+++ courier-0.53.2/debian/courier-ldap.init 2006-08-27 13:28:36.000000000
+0200
@@ -18,10 +18,14 @@
# MA 02111-1307 USA.
CONFFILE=/etc/courier/ldapaliasrc
-DAEMON=/usr/sbin/courierldapaliasd
+PROGRAM="Courier LDAP alias daemon"
+DAEMON="courierldapaliasd"
+EXEC="/usr/sbin/$DAEMON"
+
+. /lib/lsb/init-functions
# stop if the courier-ldap package has been removed
-if ! [ -x $DAEMON ]; then
+if ! [ -x $EXEC ]; then
exit 0
fi
@@ -32,24 +36,23 @@
case "$1" in
start)
- # Start Courier LDAP alias daemon
- echo -n "Starting Courier LDAP alias daemon: "
- $DAEMON start
- echo "done."
+ log_daemon_msg "Starting $PROGRAM" "$DAEMON"
+ $EXEC start
+ log_end_msg 0
;;
stop)
- # Stop PCP daemon
- echo -n "Stopping Courier LDAP alias daemon: "
- $DAEMON stop
- echo "done."
+ log_daemon_msg "Stopping $PROGRAM" "$DAEMON"
+ $EXEC stop
+ log_end_msg 0
;;
restart | reload | force-reload)
- echo -n "Restarting Courier LDAP alias daemon: "
- $DAEMON restart
- echo "done."
- ;;
+ log_daemon_msg "Restarting $PROGRAM" "$DAEMON"
+ $EXEC restart
+ log_end_msg 0
+ ;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
- exit 1
+ exit 2
;;
esac
+exit 0
diff -Nur courier-0.53.2.orig/debian/courier-mta.init
courier-0.53.2/debian/courier-mta.init
--- courier-0.53.2.orig/debian/courier-mta.init 2006-08-27 11:50:37.000000000
+0200
+++ courier-0.53.2/debian/courier-mta.init 2006-08-27 13:40:10.000000000
+0200
@@ -7,6 +7,8 @@
libexecdir="${prefix}/lib/courier"
DAEMON=${sbindir}/esmtpd
+. /lib/lsb/init-functions
+
test -f $DAEMON || exit 0
test -f "$sysconfdir/esmtpd" || exit 0
test -f "$sysconfdir/esmtpd-msa" || exit 0
@@ -32,79 +34,79 @@
start)
cd /
- echo -n "Starting Courier mail server:"
+ log_daemon_msg "Starting Courier mail server" "courier"
${sbindir}/courier start
- echo " done."
+ log_end_msg 0
- echo -n "Starting Courier mail filter:"
- ${sbindir}/courierfilter start
- echo " done."
+ log_daemon_msg "Starting Courier mail filter" "courierfilter"
+ ${sbindir}/courierfilter start
+ log_end_msg 0
if [ "$START_MTA" = "yes" ]; then
- echo -n "Starting Courier SMTP server:"
+ log_daemon_msg "Starting Courier SMTP server" "esmtpd"
${sbindir}/esmtpd start
- echo " done."
+ log_end_msg 0
fi
if [ "$START_MSA" = "yes" ]; then
- echo -n "Starting Courier SMTP MSA server:"
+ log_daemon_msg "Starting Courier SMTP MSA server" "esmtpd-msa"
${sbindir}/esmtpd-msa start
- echo " done."
+ log_end_msg 0
fi
;;
stop)
cd /
if [ "$START_MSA" = "yes" ]; then
- echo -n "Stopping Courier SMTP MSA server:"
+ log_daemon_msg "Stopping Courier SMTP MSA server" "esmtpd-msa"
${sbindir}/esmtpd-msa stop
- echo " done."
+ log_end_msg 0
fi
if [ "$START_MTA" = "yes" ]; then
- echo -n "Stopping Courier SMTP server:"
+ log_daemon_msg "Stopping Courier SMTP server" "esmtpd"
${sbindir}/esmtpd stop
- echo " done."
+ log_end_msg 0
fi
- echo -n "Stopping Courier mail filter:"
+ log_daemon_msg "Stopping Courier mail filter" "courierfilter"
${sbindir}/courierfilter stop
- echo " done."
+ log_end_msg 0
- echo -n "Stopping Courier mail server:"
+ log_daemon_msg "Stopping Courier mail server" "courier"
${sbindir}/courier stop
- echo " done."
+ log_end_msg 0
;;
reload | force-reload)
cd /
if [ "$START_MSA" = "yes" ]; then
- echo -n "Restarting Courier SMTP MSA server:"
+ log_daemon_msg "Restarting Courier SMTP MSA server" "esmtpd-dsa"
${sbindir}/esmtpd-msa restart
- echo " done."
+ log_end_msg 0
fi
if [ "$START_MTA" = "yes" ]; then
- echo -n "Restarting Courier SMTP server:"
+ log_daemon_msg "Restarting Courier SMTP server" "esmtpd"
${sbindir}/esmtpd restart
- echo " done."
+ log_end_msg 0
fi
- echo -n "Restarting Courier mail filter:"
+ log_daemon_msg "Restarting Courier mail filter" "courierfilter"
${sbindir}/courierfilter restart
- echo " done."
+ log_end_msg 0
- echo -n "Restarting Courier mail server:"
+ log_daemon_msg "Restarting Courier mail server" "courier"
${sbindir}/courier restart
- echo " done."
- ;;
+ log_end_msg 0
+ ;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
- exit 1
+ exit 2
;;
esac
exit 0
diff -Nur courier-0.53.2.orig/debian/courier-mta-ssl.init
courier-0.53.2/debian/courier-mta-ssl.init
--- courier-0.53.2.orig/debian/courier-mta-ssl.init 2006-08-27
11:50:37.000000000 +0200
+++ courier-0.53.2/debian/courier-mta-ssl.init 2006-08-27 13:43:51.000000000
+0200
@@ -3,28 +3,32 @@
sysconfdir="/etc/courier"
sbindir="/usr/sbin"
TCPD=${sbindir}/couriertcpd
-DAEMONPROG=${sbindir}/esmtpd-ssl
+PROGRAM="Courier SMTP/SSL server"
+DAEMON="esmtpd-ssl"
+DAEMONPROG=${sbindir}/$DAEMON
+
+. /lib/lsb/init-functions
test -f $DAEMONPROG || exit 0
# check for couriertcpd
if ! [ -x $TCPD ]; then
- exit 0
+ exit 0
fi
# check for couriertls
if ! [ -x $COURIERTLS ]; then
- exit 0
+ exit 0
fi
# check for esmtpd configuration file
if ! [ -f ${sysconfdir}/esmtpd ]; then
- exit 0
+ exit 0
fi
# check for esmtpd-ssl configuration file
if ! [ -f ${sysconfdir}/esmtpd-ssl ]; then
- exit 0
+ exit 0
fi
. ${sysconfdir}/esmtpd
@@ -32,22 +36,22 @@
case "$1" in
start)
- echo -n "Starting Courier SMTP/SSL server:"
- ${sbindir}/esmtpd-ssl start
- echo " done."
+ log_daemon_msg "Starting $PROGRAM" "$DAEMON"
+ $DAEMONPROG start
+ log_end_msg 0
;;
stop)
- echo -n "Stopping Courier SMTP/SSL server:"
- ${sbindir}/esmtpd-ssl stop
- echo " done."
+ log_daemon_msg "Stopping $PROGRAM" "$DAEMON"
+ $DAEMONPROG stop
+ log_end_msg 0
;;
restart | reload | force-reload)
- $0 stop
- $0 start
- ;;
+ $0 stop
+ $0 start
+ ;;
*)
- echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
- exit 1
- ;;
+ echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
+ exit 2
+ ;;
esac
exit 0
diff -Nur courier-0.53.2.orig/debian/courier-pop.init
courier-0.53.2/debian/courier-pop.init
--- courier-0.53.2.orig/debian/courier-pop.init 2006-08-27 11:50:37.000000000
+0200
+++ courier-0.53.2/debian/courier-pop.init 2006-08-27 13:48:28.000000000
+0200
@@ -11,16 +11,18 @@
PROG="pop3d"
SSLCONFIG=
+. /lib/lsb/init-functions
+
test -f $DAEMON || exit 0
if ! [ -x $TCPD ]; then
- echo "ERR: $TCPD missing"
- exit 1
+ log_action_msg "$PROGRAM: ERROR - $TCPD missing"
+ exit 1
fi
if ! [ -f ${sysconfdir}/pop3d ]; then
- echo "ERR: config file missing"
- exit 1
+ log_action_msg "$PROGRAM: ERROR - config file missing"
+ exit 1
fi
# read/set defaults
@@ -39,40 +41,40 @@
START=no
case "$POP3DSTART" in
- [yY]*)START=yes;;
+ [yY]*)START=yes;;
esac
+if [ "$START" = "no" ]; then
+ exit 0
+fi
+
case "$1" in
start)
- if [ "$START" = "yes" ]; then
- echo -n "Starting $PROGRAM:"
-
- /usr/bin/env - /bin/sh -c " set -a; \
+ log_daemon_msg "Starting $PROGRAM" "$PROG"
+ /usr/bin/env - /bin/sh -c " set -a; \
. ${sysconfdir}/pop3d; \
if [ "$SSLCONFIG" ]; then . ${sysconfdir}/pop3d-ssl; fi; \
POP3_STARTTLS=$POP3_STARTTLS; export POP3_STARTTLS; \
TLS_PROTOCOL=$TLS_STARTTLS_PROTOCOL; \
- $TCPD -pid=$PIDFILE -stderrlogger=${sbindir}/courierlogger \
+ $TCPD -pid=$PIDFILE -stderrlogger=${sbindir}/courierlogger \
-maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \
$TCPDOPTS -address=$ADDRESS $PORT \
${libexecdir}/courier/courierpop3login $AUTHMODULELIST \
${libexecdir}/courier/courierpop3d $MAILDIR"
- echo " $PROG."
- fi
- ;;
+ log_end_msg 0
+ ;;
stop)
- echo -n "Stopping $PROGRAM:"
- $TCPD -pid=$PIDFILE -stop
- echo " $PROG."
- ;;
+ log_daemon_msg "Stopping $PROGRAM" "$PROG"
+ $TCPD -pid=$PIDFILE -stop
+ log_end_msg 0
+ ;;
restart | reload | force-reload)
- $0 stop
- $0 start
- ;;
+ $0 stop
+ $0 start
+ ;;
*)
- echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
- exit 1
- ;;
+ echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
+ exit 2
+ ;;
esac
-
exit 0
diff -Nur courier-0.53.2.orig/debian/courier-pop-ssl.init
courier-0.53.2/debian/courier-pop-ssl.init
--- courier-0.53.2.orig/debian/courier-pop-ssl.init 2006-08-27
11:50:37.000000000 +0200
+++ courier-0.53.2/debian/courier-pop-ssl.init 2006-08-27 13:53:39.000000000
+0200
@@ -11,20 +11,23 @@
DAEMON=pop3d-ssl
PROGRAM="Courier POP3-SSL server"
+. /lib/lsb/init-functions
+
test -f $DAEMONPROG || exit 0
if ! [ -x $TCPD ]; then
- echo "ERR: $TCPD missing"
- exit 1
+ log_action_msg "$PROGRAM: ERROR - $TCPD missing"
+ exit 1
fi
if ! [ -f ${sysconfdir}/pop3d ]; then
- echo "ERR: config file missing"
- exit 1
+ log_action_msg "$PROGRAM: ERROR - config file missing"
+ exit 1
fi
+
if ! [ -f ${sysconfdir}/pop3d-ssl ]; then
- echo "ERR: config file missing"
- exit 1
+ log_action_msg "$PROGRAM: ERROR - config file missing"
+ exit 1
fi
# read/set defaults
@@ -39,8 +42,8 @@
. ${sysconfdir}/pop3d-ssl
if ! [ -x $COURIERTLS ]; then
- echo "ERR: $COURIERTLS missing"
- exit 1
+ log_action_msg "$PROGRAM: ERROR - $COURIERTLS missing"
+ exit 1
fi
START=no
@@ -54,9 +57,8 @@
case "$1" in
start)
- echo -n "Starting $PROGRAM:"
-
- /usr/bin/env - PATH="$PATH" SHELL="$SHELL" \
+ log_daemon_msg "Starting $PROGRAM" "$DAEMON"
+ /usr/bin/env - PATH="$PATH" SHELL="$SHELL" \
/bin/sh -c " . ${sysconfdir}/pop3d ; \
. ${sysconfdir}/pop3d-ssl ; \
POP3_TLS=1 ; export POP3_TLS ; \
@@ -64,28 +66,28 @@
sed 's/=.*//;s/^/export /;s/$/;/'`
`sed -n '/^#/d;/=/p' <${sysconfdir}/pop3d-ssl | \
sed 's/=.*//;s/^/export /;s/$/;/'`
- PROXY_HOSTNAME=$PROXY_HOSTNAME; \
- /usr/sbin/courierlogger -pid=$SSLPIDFILE -start $SSLLOGGEROPTS \
- $TCPD -address=$SSLADDRESS \
- -maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \
- $TCPDOPTS \
- $SSLPORT $COURIERTLS -server -tcpd \
- ${libexecdir}/courier/courierpop3login \
- ${libexecdir}/courier/courierpop3d $MAILDIR"
- echo " $DAEMON."
+ PROXY_HOSTNAME=$PROXY_HOSTNAME; \
+ /usr/sbin/courierlogger -pid=$SSLPIDFILE -start $SSLLOGGEROPTS \
+ $TCPD -address=$SSLADDRESS \
+ -maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \
+ $TCPDOPTS \
+ $SSLPORT $COURIERTLS -server -tcpd \
+ ${libexecdir}/courier/courierpop3login \
+ ${libexecdir}/courier/courierpop3d $MAILDIR"
+ log_end_msg 0
;;
stop)
- echo -n "Stopping $PROGRAM:"
- /usr/sbin/courierlogger -pid=$SSLPIDFILE -stop
- echo " $DAEMON."
+ log_daemon_msg "Stopping $PROGRAM" "$DAEMON"
+ /usr/sbin/courierlogger -pid=$SSLPIDFILE -stop
+ log_end_msg 0
;;
-restart | reload | force-reload)
- $0 stop
- $0 start
+restart|reload|force-reload)
+ $0 stop
+ $0 start
;;
*)
- echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
- exit 1
- ;;
+ echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
+ exit 2
+ ;;
esac
exit 0
diff -Nur courier-0.53.2.orig/debian/sqwebmail.init
courier-0.53.2/debian/sqwebmail.init
--- courier-0.53.2.orig/debian/sqwebmail.init 2006-08-27 11:50:37.000000000
+0200
+++ courier-0.53.2/debian/sqwebmail.init 2006-08-27 13:56:55.000000000
+0200
@@ -17,32 +17,35 @@
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA.
-DAEMON=/usr/sbin/webmaild
+PROGRAM="Courier webmail daemon"
+DAEMON="webmaild"
+EXEC=/usr/sbin/$DAEMON
# stop if the sqwebmail package has been removed
-if ! [ -x $DAEMON ]; then
+if ! [ -x $EXEC ]; then
exit 0
fi
case "$1" in
start)
# Start webmail daemon
- echo -n "Starting Courier webmail daemon: "
- $DAEMON start
- echo "done."
+ log_daemon_msg "Starting $PROGRAM" "$DAEMON"
+ $EXEC start
+ log_end_msg 0
;;
stop)
# Stop webmail daemon
- echo -n "Stopping Courier webmail daemon: "
- $DAEMON stop
- echo "done."
+ log_daemon_msg "Stopping $PROGRAM" "$DAEMON"
+ $EXEC stop
+ log_end_msg 0
;;
restart | reload | force-reload)
- $0 stop
- $0 start
- ;;
+ $0 stop
+ $0 start
+ ;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
- exit 1
+ exit 2
;;
esac
+exit 0