2
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
4
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
6
# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
7
# /etc/init.d/postfwd: v1 2008/03/12 Jan Wagner <waja@cyconet.org>
11
# Required-Start: $local_fs $network $remote_fs $syslog
12
# Required-Stop: $local_fs $network $remote_fs $syslog
13
# Default-Start: 2 3 4 5
15
# Short-Description: start and stop the postfw daemon
16
# Description: a Perl policy daemon for the Postfix MTA
19
PATH=/sbin:/bin:/usr/sbin:/usr/bin
21
DAEMON=/usr/sbin/${NAME}
22
PIDFILE=/var/run/$NAME.pid
25
. /lib/lsb/init-functions
27
test -x $DAEMON || exit 0
30
echo "#### WARNING ####"
31
echo "${NAME} won't be started/stopped unless it is configured."
32
echo "If you want to start ${NAME} as daemon, see /etc/default/${NAME}."
33
echo "#################"
38
echo "#### WARNING ####"
39
echo "${NAME} won't be started/stopped unless a rules file is provided at $CONF."
40
echo "#################"
44
# check if postfwd is configured or not
45
if [ -f "/etc/default/$NAME" ]
48
if [ "$STARTUP" != "1" ]
56
# check if rules file is there
62
# Check whether we have to drop privileges.
65
if ! getent passwd "$RUNAS" >/dev/null; then
74
echo -n "Starting $DESC: "
75
start-stop-daemon --start --quiet \
77
--exec $DAEMON -- ${ARGS} --daemon --file=${CONF} --interface=${INET} --port=${PORT} --user=${RUNAS} --group=${RUNAS} --pidfile=$PIDFILE
81
echo -n "Stopping $DESC: "
82
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE && rm -rf $PIDFILE
86
echo "Reloading $DESC configuration files."
87
kill -HUP $(cat $PIDFILE)
90
echo -n "Restarting $DESC (incl. cache): "
98
echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2