# Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for exim by Tim Cutts <timc@chiark.greenend.org.uk>
-# Modified for exim4 by Andreas Metzler <ametzler@downhill.at.eu.org>
+# Modified for exim4 by Andreas Metzler <ametzler@debian.org>
# and Marc Haber <mh+debian-packages@zugschlus.de>
### BEGIN INIT INFO
QUEUERUNNER='combined'
QUEUEINTERVAL='30m'
UPEX4OPTS=''
-PIDFILE="/var/run/exim4/exim.pid"
-QRPIDFILE="/var/run/exim4/eximqr.pid"
[ -f /etc/default/exim4 ] && . /etc/default/exim4
+PIDFILE="/run/exim4/exim.pid"
+QRPIDFILE="/run/exim4/eximqr.pid"
upex4conf() {
UPEX4CONF="update-exim4.conf"
for p in $PATH; do
if [ -x "$p/$UPEX4CONF" ]; then
IFS="$OLDIFS"
- $p/$UPEX4CONF $UPEX4OPTS
+ $p/$UPEX4CONF $UPEX4OPTS $1
return 0
fi
done
start_exim()
{
- [ -e /var/run/exim4 ] || \
- install -d -oDebian-exim -gDebian-exim -m750 /var/run/exim4
+ [ -e /run/exim4 ] || \
+ install -d -oDebian-exim -gDebian-exim -m750 /run/exim4
case ${QUEUERUNNER} in
combined)
start_daemon -p "$PIDFILE" \
log_progress_msg "exim4_queuerunner"
;;
queueonly)
- start_daemon -p "$QRPIDFILE" \
- "$DAEMON" -oP $QRPIDFILE \
+ start_daemon -p "$PIDFILE" \
+ "$DAEMON" -oP $PIDFILE \
"-q${QFLAGS}${QUEUEINTERVAL}" \
${COMMONOPTIONS} \
${QUEUERUNNEROPTIONS}
reload_exim()
{
case ${QUEUERUNNER} in
- combined|no|ppp)
+ combined|no|ppp|queueonly)
killproc -p "$PIDFILE" "$DAEMON" -HUP
log_progress_msg "exim4"
;;
QRNAME="separate queue runner daemon"
if [ "${QUEUERUNNER}" = "combined" ]; then
SMTPNAME="combined SMTP listener and queue runner daemon"
+ elif [ "${QUEUERUNNER}" = "queueonly" ]; then
+ SMTPNAME="separate queue runner daemon"
fi
log_action_begin_msg "checking $QRNAME"
if pidofproc -p "$QRPIDFILE" "$DAEMON" >/dev/null; then
warn_paniclog
;;
restart)
+ # check whether newly generated config would work
+ upex4conf --check
log_daemon_msg "Stopping MTA for restart"
+ stop_exim
# regenerate exim4.conf
upex4conf
isconfigvalid
- stop_exim
log_end_msg 0
sleep 2
log_daemon_msg "Restarting MTA"
kill_all_exims $2
;;
*)
- echo "Usage: $0 {start|stop|restart|reload|status|what|force-stop}"
+ echo "Usage: $0 {start|stop|restart|reload|status|force-stop}"
exit 1
;;
esac