michael@171: #!@l_prefix@/bin/openpkg rc michael@171: ## michael@171: ## rc.postfix-mailgraph -- Run-Commands michael@171: ## michael@171: michael@171: %config michael@171: postfix_mailgraph_enable="$openpkg_rc_def" michael@193: postfix_mailgraph_flags="" michael@171: michael@171: %common michael@171: postfix_mailgraph_pidfile="@l_prefix@/var/postfix-mailgraph/run/mailgraph.pid" michael@171: postfix_mailgraph_signal () { michael@171: [ -f $postfix_mailgraph_pidfile ] \ michael@171: && kill -$1 `cat $postfix_mailgraph_pidfile` michael@171: } michael@171: michael@171: %status -u @l_susr@ -o michael@171: postfix_mailgraph_usable="unknown" michael@171: postfix_mailgraph_active="no" michael@171: rcService postfix-mailgraph enable yes && \ michael@171: postfix_mailgraph_signal 0 && postfix_mailgraph_active="yes" michael@171: echo "postfix_mailgraph_enable=\"$postfix_mailgraph_enable\"" michael@171: echo "postfix_mailgraph_usable=\"$postfix_mailgraph_usable\"" michael@171: echo "postfix_mailgraph_active=\"$postfix_mailgraph_active\"" michael@171: michael@171: %start -u @l_susr@ michael@171: rcService postfix-mailgraph enable yes || exit 0 michael@171: rcService postfix-mailgraph active yes && exit 0 michael@193: @l_prefix@/sbin/mailgraph --daemon ${postfix_mailgraph_flags} michael@171: michael@171: %stop -u @l_susr@ michael@171: rcService postfix-mailgraph enable yes || exit 0 michael@171: rcService postfix-mailgraph active no && exit 0 michael@171: postfix_mailgraph_signal TERM michael@171: michael@171: %restart -u @l_susr@ michael@171: rcService postfix-mailgraph enable yes || exit 0 michael@171: rcService postfix-mailgraph active no && exit 0 michael@193: rc postfix-mailgraph stop michael@171: sleep 2 michael@193: rc postfix-mailgraph start michael@171: