Sun, 02 Sep 2012 18:18:43 +0200
Introduce new version of tcpdump, reorder taglib and cryptbreaker to
the end because they fail to build on Linux, and correct flawed URLs
probably copied from the doxygen build entry.
michael@562 | 1 | #!@l_prefix@/bin/openpkg rc |
michael@562 | 2 | ## |
michael@562 | 3 | ## rc.cfengine -- Run-Commands |
michael@562 | 4 | ## |
michael@562 | 5 | |
michael@562 | 6 | %config |
michael@562 | 7 | cfengine_enable="$openpkg_rc_def" |
michael@562 | 8 | cfengine_cservd_flags="" |
michael@562 | 9 | cfengine_cenvd_flags="" |
michael@562 | 10 | cfengine_log_prolog="true" |
michael@562 | 11 | cfengine_log_epilog="true" |
michael@562 | 12 | cfengine_log_numfiles="10" |
michael@562 | 13 | cfengine_log_minsize="1M" |
michael@562 | 14 | cfengine_log_complevel="9" |
michael@562 | 15 | |
michael@562 | 16 | %common |
michael@562 | 17 | cfengine_cfservd_pidfile="@l_prefix@/var/cfengine/cfservd.pid" |
michael@562 | 18 | cfengine_cfenvd_pidfile="@l_prefix@/var/cfengine/cfenvd.pid" |
michael@562 | 19 | cfengine_signal () { |
michael@562 | 20 | [ -f $cfengine_cfservd_pidfile ] \ |
michael@562 | 21 | && kill -$1 `cat $cfengine_cfservd_pidfile` |
michael@562 | 22 | local rc=$? |
michael@562 | 23 | [ -f $cfengine_cfenvd_pidfile ] \ |
michael@562 | 24 | && kill -$1 `cat $cfengine_cfenvd_pidfile` \ |
michael@562 | 25 | && [ $rc -eq 0 ] |
michael@562 | 26 | } |
michael@562 | 27 | |
michael@562 | 28 | %status -u @l_susr@ -o |
michael@562 | 29 | cfengine_usable="unknown" |
michael@562 | 30 | cfengine_active="no" |
michael@562 | 31 | rcService cfengine enable yes && \ |
michael@562 | 32 | cfengine_signal 0 && cfengine_active="yes" |
michael@562 | 33 | echo "cfengine_enable=\"$cfengine_enable\"" |
michael@562 | 34 | echo "cfengine_usable=\"$cfengine_usable\"" |
michael@562 | 35 | echo "cfengine_active=\"$cfengine_active\"" |
michael@562 | 36 | |
michael@562 | 37 | %start -u @l_susr@ |
michael@562 | 38 | rcService cfengine enable yes || exit 0 |
michael@562 | 39 | rcService cfengine active yes && exit 0 |
michael@562 | 40 | ( nohup @l_prefix@/sbin/cfservd \ |
michael@562 | 41 | --no-fork $cfengine_cfservd_flags \ |
michael@562 | 42 | </dev/null >/dev/null 2>&1 & |
michael@562 | 43 | echo $! >$cfengine_cfservd_pidfile |
michael@562 | 44 | ) >/dev/null 2>&1 |
michael@562 | 45 | ( nohup @l_prefix@/sbin/cfenvd \ |
michael@562 | 46 | --no-fork $cfengine_cfenvd_flags \ |
michael@562 | 47 | </dev/null >/dev/null 2>&1 & |
michael@562 | 48 | echo $! >$cfengine_cfenvd_pidfile |
michael@562 | 49 | ) >/dev/null 2>&1 |
michael@562 | 50 | |
michael@562 | 51 | %stop -u @l_susr@ |
michael@562 | 52 | rcService cfengine enable yes || exit 0 |
michael@562 | 53 | rcService cfengine active no && exit 0 |
michael@562 | 54 | cfengine_signal TERM |
michael@562 | 55 | sleep 2 |
michael@562 | 56 | rm -f $cfengine_cfservd_pidfile 2>/dev/null || true |
michael@562 | 57 | rm -f $cfengine_cfenvd_pidfile 2>/dev/null || true |
michael@562 | 58 | |
michael@562 | 59 | %restart -u @l_susr@ |
michael@562 | 60 | rcService cfengine enable yes || exit 0 |
michael@562 | 61 | rcService cfengine active no && exit 0 |
michael@562 | 62 | rc cfengine stop start |
michael@562 | 63 | |
michael@562 | 64 | %daily -u @l_susr@ |
michael@562 | 65 | rcService cfengine enable yes || exit 0 |
michael@562 | 66 | shtool rotate -f \ |
michael@562 | 67 | -n ${cfengine_log_numfiles} -s ${cfengine_log_minsize} -d \ |
michael@562 | 68 | -z ${cfengine_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \ |
michael@562 | 69 | -P "${cfengine_log_prolog}" \ |
michael@562 | 70 | -E "${cfengine_log_epilog}" \ |
michael@562 | 71 | @l_prefix@/var/cfengine/cfengine.log |
michael@562 | 72 |