1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
#!/bin/sh
# /etc/init.d/mailutils-pop3d
#
# This file is in the PUBLIC DOMAIN
# Written by Jeff Bailey <jbailey@debian.org>
set -e
DAEMON=/usr/sbin/pop3d
NAME=mailutils-pop3d
PIDFILE=/var/run/${NAME}.pid
test -x $DAEMON || exit 0
if test -f /etc/default/mailutils-pop3d; then
. /etc/default/mailutils-pop3d
fi
# Only start if RUN_AS_DAEMON is set.
if [ ! $RUN_AS_DAEMON ]; then
exit 0
fi
# Ask for a pidfile if we've defined one
if [ $PIDFILE ]; then
ARGS="$ARGS --pidfile=$PIDFILE"
fi
if [ $MAX_CHILDREN ]; then
ARGS="$ARGS --daemon=$MAX_CHILDREN"
fi
if [ $AUTHENTICATION ]; then
ARGS="$ARGS --authentication=$AUTHENTICATION"
fi
if [ $AUTHORISATION ]; then
ARGS="$ARGS --authorization=$AUTHORISATION"
fi
if [ $TIMEOUT ]; then
ARGS="$ARGS --timeout=$TIMEOUT"
fi
case "$1" in
start)
echo -n "Starting POP3 server: "
# Work around strange bug where pop3d will sometimes spin out.
ulimit -d 100000 -l 100000 -m 100000 -s 100000 -v 100000
start-stop-daemon --start --pidfile $PIDFILE -- $ARGS
echo $NAME
;;
stop)
echo -n "Stopping POP3 server: "
start-stop-daemon --stop --pidfile $PIDFILE
echo $NAME
;;
reload|force-reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload}"
exit 1
;;
esac
exit 0
|