a way to choose between postfwd and postfwd2

This commit is contained in:
Jan Wagner 2010-06-16 14:35:43 +00:00
parent dc1d9f7d40
commit 282172dd79
3 changed files with 29 additions and 6 deletions

View file

@ -58,4 +58,10 @@ In order to avoid the startup of the daemon on an unconfigured machine,
automatic startup, on boot, is disabled by default. To enable it just edit the
file /etc/default/postfwd and set the "startup" variable to 1.
4. CHOOSING WHICH POSTFWD VERSION TO USE
----------------------------------------
Since some time, there is also a prefork version available, called postfwd2.
You can choose in /etc/default/postfwd to use 'postfwd' or postfwd2'.
-- Jan Wagner <waja@cyconet.org> Mon, 10 Mar 2008 22:37:44 +0100

View file

@ -3,6 +3,8 @@
# Set to '1' to enable startup (daemon mode)
STARTUP=0
# using 'postfwd' or 'postfwd2'?
BINARY=postfwd
# Config file
CONF=/etc/postfix/postfwd.cf
# IP where listen to

27
debian/postfwd.init vendored
View file

@ -18,11 +18,6 @@
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=postfwd
DAEMON=/usr/sbin/${NAME}
PIDFILE=/var/run/$NAME.pid
DESC=postfwd
test -x $DAEMON || exit 0
not_configured () {
echo "#### WARNING ####"
@ -39,6 +34,13 @@ no_configfile () {
exit 0
}
wrong_binary () {
echo "#### ERROR ####"
echo "${BINARY} is not a valid binary"
echo "###############"
exit 0
}
# check if postfwd is configured or not
if [ -f "/etc/default/$NAME" ]
then
@ -58,12 +60,25 @@ then
fi
# Check whether we have to drop privileges.
if [ -n "$RUNAS" ]; then
if [ -n "$RUNAS" ]
then
if ! getent passwd "$RUNAS" >/dev/null; then
RUNAS=""
fi
fi
if ! [ ${BINARY} == "postfwd" -o ${BINARY} == "postfwd2" ]
then
wrong_binary
fi
NAME=${BINARY}
DAEMON=/usr/sbin/${NAME}
PIDFILE=/var/run/$NAME.pid
DESC=postfwd
test -x $DAEMON || exit 0
set -e
case "$1" in