diff -r 88a7941704d2 -r b72f2be1f619 postfix-mailgraph/rc.postfix-mailgraph --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/postfix-mailgraph/rc.postfix-mailgraph Sun Apr 19 14:07:25 2009 +0200 @@ -0,0 +1,41 @@ +#!@l_prefix@/bin/openpkg rc +## +## rc.postfix-mailgraph -- Run-Commands +## + +%config + postfix_mailgraph_enable="$openpkg_rc_def" + +%common + postfix_mailgraph_pidfile="@l_prefix@/var/postfix-mailgraph/run/mailgraph.pid" + postfix_mailgraph_signal () { + [ -f $postfix_mailgraph_pidfile ] \ + && kill -$1 `cat $postfix_mailgraph_pidfile` + } + +%status -u @l_susr@ -o + postfix_mailgraph_usable="unknown" + postfix_mailgraph_active="no" + rcService postfix-mailgraph enable yes && \ + postfix_mailgraph_signal 0 && postfix_mailgraph_active="yes" + echo "postfix_mailgraph_enable=\"$postfix_mailgraph_enable\"" + echo "postfix_mailgraph_usable=\"$postfix_mailgraph_usable\"" + echo "postfix_mailgraph_active=\"$postfix_mailgraph_active\"" + +%start -u @l_susr@ + rcService postfix-mailgraph enable yes || exit 0 + rcService postfix-mailgraph active yes && exit 0 + @l_prefix@/sbin/mailgraph --daemon + +%stop -u @l_susr@ + rcService postfix-mailgraph enable yes || exit 0 + rcService postfix-mailgraph active no && exit 0 + postfix_mailgraph_signal TERM + +%restart -u @l_susr@ + rcService postfix-mailgraph enable yes || exit 0 + rcService postfix-mailgraph active no && exit 0 + postfix_mailgraph_signal TERM + sleep 2 + @l_prefix@/sbin/mailgraph --daemon +