#!/bin/sh # # $FreeBSD: head/japanese/mailman/files/mailman.in 360783 2014-07-05 17:42:23Z tota $ # # PROVIDE: mailman # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable mailman: # mailman_enable (bool): Set it to "YES" to enable mailman. # Default is "NO". . /etc/rc.subr name="mailman" rcvar=mailman_enable pidfile="%%MAILMANDIR%%/data/master-qrunner.pid" load_rc_config $name : ${mailman_enable="NO"} start_cmd=${name}_start stop_cmd=${name}_stop status_cmd=${name}_status extra_commands="reload status" mailman_start() { %%MAILMANDIR%%/bin/mailmanctl -s -q start } mailman_stop() { [ -f $pidfile ] \ && %%MAILMANDIR%%/bin/mailmanctl -q stop \ || echo ${name} not running? \(check ${pidfile}\) } mailman_status() { local retcode=0 if [ -f $pidfile ] && ps -p $(cat $pidfile) > /dev/null; then echo $name is running as pid $(cat $pidfile). else echo $name is not running. retcode=1 fi return $retcode } run_rc_command "$1"