summaryrefslogtreecommitdiff
path: root/mailman/mailman.rc
blob: 3dc82b9dac861ebc55ff5d9d40bc54c6e4ac9320 (plain)
    1 #!/bin/sh
    2 #
    3 # /etc/rc.d/mailman: start/stop mailman daemon
    4 #
    5 
    6 SSD=/sbin/start-stop-daemon
    7 PROG=/usr/lib/mailman/bin/mailmanctl
    8 PID=/var/run/mailman/master-qrunner.pid
    9 
   10 fix_log_perms() {
   11 	local errorlog="/var/log/mailman/error"
   12 	if [ ! -f $errorlog ]; then
   13 		touch $errorlog
   14 		chown root:mailman $errorlog
   15 		chmod 775 $errorlog
   16 	fi
   17 }
   18 
   19 case $1 in
   20 start)
   21 	fix_log_perms
   22 	$SSD --start --pidfile $PID --exec $PROG -- -q start
   23 	;;
   24 stop)
   25 	$SSD --start --pidfile $PID --exec $PROG -- -q stop
   26 	$SSD --stop --retry 10 --pidfile $PID
   27 	;;
   28 restart)
   29 	$0 stop
   30 	$0 start
   31 	;;
   32 reload)
   33 	$SSD --start --pidfile $PID --exec $PROG -- -q restart
   34 	;;
   35 status)
   36 	$SSD --status --pidfile $PID
   37 	case $? in
   38 	0) echo "$PROG is running with pid $(cat $PID)" ;;
   39 	1) echo "$PROG is not running but the pid file $PID exists" ;;
   40 	3) echo "$PROG is not running" ;;
   41 	4) echo "Unable to determine the program status" ;;
   42 	esac
   43 	;;
   44 *)
   45 	echo "usage: $0 [start|stop|restart|reload|status]"
   46 	;;
   47 esac
   48 
   49 # End of file

Generated by cgit