1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/postfix-mailgraph/rc.postfix-mailgraph Sun Apr 19 14:07:25 2009 +0200 1.3 @@ -0,0 +1,41 @@ 1.4 +#!@l_prefix@/bin/openpkg rc 1.5 +## 1.6 +## rc.postfix-mailgraph -- Run-Commands 1.7 +## 1.8 + 1.9 +%config 1.10 + postfix_mailgraph_enable="$openpkg_rc_def" 1.11 + 1.12 +%common 1.13 + postfix_mailgraph_pidfile="@l_prefix@/var/postfix-mailgraph/run/mailgraph.pid" 1.14 + postfix_mailgraph_signal () { 1.15 + [ -f $postfix_mailgraph_pidfile ] \ 1.16 + && kill -$1 `cat $postfix_mailgraph_pidfile` 1.17 + } 1.18 + 1.19 +%status -u @l_susr@ -o 1.20 + postfix_mailgraph_usable="unknown" 1.21 + postfix_mailgraph_active="no" 1.22 + rcService postfix-mailgraph enable yes && \ 1.23 + postfix_mailgraph_signal 0 && postfix_mailgraph_active="yes" 1.24 + echo "postfix_mailgraph_enable=\"$postfix_mailgraph_enable\"" 1.25 + echo "postfix_mailgraph_usable=\"$postfix_mailgraph_usable\"" 1.26 + echo "postfix_mailgraph_active=\"$postfix_mailgraph_active\"" 1.27 + 1.28 +%start -u @l_susr@ 1.29 + rcService postfix-mailgraph enable yes || exit 0 1.30 + rcService postfix-mailgraph active yes && exit 0 1.31 + @l_prefix@/sbin/mailgraph --daemon 1.32 + 1.33 +%stop -u @l_susr@ 1.34 + rcService postfix-mailgraph enable yes || exit 0 1.35 + rcService postfix-mailgraph active no && exit 0 1.36 + postfix_mailgraph_signal TERM 1.37 + 1.38 +%restart -u @l_susr@ 1.39 + rcService postfix-mailgraph enable yes || exit 0 1.40 + rcService postfix-mailgraph active no && exit 0 1.41 + postfix_mailgraph_signal TERM 1.42 + sleep 2 1.43 + @l_prefix@/sbin/mailgraph --daemon 1.44 +