masqmail
diff debian/masqmail.init @ 0:08114f7dcc23
this is masqmail-0.2.21 from oliver kurth
author | meillo@marmaro.de |
---|---|
date | Fri, 26 Sep 2008 17:05:23 +0200 |
parents | |
children | af25f5c39d90 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/debian/masqmail.init Fri Sep 26 17:05:23 2008 +0200 1.3 @@ -0,0 +1,104 @@ 1.4 +#!/bin/sh 1.5 +# /etc/init.d/masqmail 1.6 +# 1.7 +# Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>. 1.8 +# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>. 1.9 +# Modified for exim by Tim Cutts <tjrc1@mole.bio.cam.ac.uk> 1.10 +# Modified for masqmail by Gregor Hoffleit <flight@debian.org> 1.11 +# Modified for masqmail by Oliver Kurth <oku@masqmail.cx> 1.12 + 1.13 +set -e 1.14 + 1.15 +# If you disable this file, masqmail can be run from /etc/inetd.conf 1.16 +#exit 0 1.17 + 1.18 +# defaults, do not edit here but in 1.19 +# /etc/default/masqmail 1.20 +INIT_SMTP_DAEMON=true 1.21 +INIT_QUEUE_DAEMON=true 1.22 +INIT_FETCH_DAEMON=false 1.23 +QUEUE_DAEMON_IVAL=-q10m 1.24 +FETCH_DAEMON_IVAL=-go5m 1.25 + 1.26 +RUN_DIR=/var/run/masqmail 1.27 + 1.28 +[ -r /etc/default/masqmail ] && . /etc/default/masqmail 1.29 + 1.30 +PATH=/sbin:/bin:/usr/sbin:/usr/bin 1.31 +DAEMON=/usr/sbin/masqmail 1.32 +NAME=masqmail 1.33 +DESC="MTA (masqmail)" 1.34 + 1.35 +test -x $DAEMON || exit 0 1.36 + 1.37 +if [ ! -f /etc/masqmail/masqmail.conf ] ; then 1.38 + echo "you have to configure masqmail first." 1.39 + exit 0 1.40 +fi 1.41 + 1.42 +if [ x"$INIT_SMTP_DAEMON" = x"true" ] || [ x"$INIT_QUEUE_DAEMON" = x"true" ] ; then 1.43 + DAEMON_ARGS= 1.44 + if [ x"$INIT_SMTP_DAEMON" = x"true" ] ; then 1.45 + DAEMON_ARGS=-bd 1.46 + fi 1.47 + 1.48 + if [ x"$INIT_QUEUE_DAEMON" = x"true" ] ; then 1.49 + DAEMON_ARGS="$DAEMON_ARGS $QUEUE_DAEMON_IVAL" 1.50 + fi 1.51 + INIT_DAEMON=true 1.52 +else 1.53 + INIT_DAEMON=false 1.54 +fi 1.55 + 1.56 +case "$1" in 1.57 + start) 1.58 + echo -n "Starting $DESC: " 1.59 + if [ x"$INIT_DAEMON" = x"true" ] ; then 1.60 + update-inetd --disable smtp 1.61 + start-stop-daemon --start --startas $DAEMON \ 1.62 + --pidfile $RUN_DIR/masqmail.pid -- $DAEMON_ARGS 1.63 + echo -n " listen/queue" 1.64 + fi 1.65 + if [ x"$INIT_FETCH_DAEMON" = x"true" ] ; then 1.66 + start-stop-daemon --start --startas $DAEMON \ 1.67 + --pidfile $RUN_DIR/masqmail-get.pid -- $FETCH_DAEMON_IVAL 1.68 + echo -n " fetch" 1.69 + fi 1.70 + echo "." 1.71 + ;; 1.72 + stop) 1.73 + echo -n "Stopping $DESC: " 1.74 + if [ -f $RUN_DIR/masqmail.pid ] ; then 1.75 + start-stop-daemon --stop --oknodo --retry 1 --name $NAME --pidfile $RUN_DIR/masqmail.pid 1.76 + update-inetd --enable smtp 1.77 + echo -n " listen/queue" 1.78 + fi 1.79 + if [ -f $RUN_DIR/masqmail-get.pid ] ; then 1.80 + start-stop-daemon --stop --oknodo --retry 1 --name $NAME --pidfile $RUN_DIR/masqmail-get.pid 1.81 + echo -n " fetch" 1.82 + fi 1.83 + echo "." 1.84 + ;; 1.85 + restart) 1.86 + $0 stop 1.87 + $0 start 1.88 + ;; 1.89 + reload|force-reload) 1.90 + echo -n "Reloading $DESC configuration files: " 1.91 + if [ -f $RUN_DIR/masqmail.pid ] ; then 1.92 + start-stop-daemon --stop --signal 1 --pidfile $RUN_DIR/masqmail.pid 1.93 + echo -n " listen/queue" 1.94 + fi 1.95 + if [ -f $RUN_DIR/masqmail-get.pid ] ; then 1.96 + start-stop-daemon --stop --signal 1 --pidfile $RUN_DIR/masqmail-get.pid 1.97 + echo -n " fetch" 1.98 + fi 1.99 + echo "." 1.100 + ;; 1.101 + *) 1.102 + echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2 1.103 + exit 1 1.104 + ;; 1.105 +esac 1.106 + 1.107 +exit 0