Fri, 03 Aug 2012 20:11:53 +0200
Neutralize buggy code causing OpenPKG to have 'fatal problems' in
spite of correct installation, configuration, and operation. An
administrator suffering from this failure is even unable to
uninstall the flawed software.
michael@64 | 1 | #!@l_prefix@/bin/openpkg rc |
michael@64 | 2 | ## |
michael@64 | 3 | ## rc.arpwatch -- runcommands |
michael@64 | 4 | ## |
michael@64 | 5 | |
michael@64 | 6 | %config |
michael@64 | 7 | arpwatch_enable="$openpkg_rc_def" |
michael@64 | 8 | arpwatch_log_prolog="true" |
michael@64 | 9 | arpwatch_log_epilog="true" |
michael@64 | 10 | arpwatch_log_numfiles="10" |
michael@64 | 11 | arpwatch_log_minsize="1M" |
michael@64 | 12 | arpwatch_log_complevel="9" |
michael@64 | 13 | arpwatch_iface="-i lo0" |
michael@64 | 14 | arpwatch_ipnet="-n 127.0.0.0/8" |
michael@64 | 15 | |
michael@64 | 16 | %common |
michael@64 | 17 | arpwatch_pidfile="@l_prefix@/var/arpwatch/run/arpwatch.pid" |
michael@64 | 18 | arpwatch_signal () { |
michael@64 | 19 | [ -f $arpwatch_pidfile ] && kill -$1 `cat $arpwatch_pidfile` |
michael@64 | 20 | } |
michael@64 | 21 | |
michael@64 | 22 | %status -u @l_susr@ -o |
michael@64 | 23 | arpwatch_usable="no" |
michael@64 | 24 | arpwatch_active="no" |
michael@64 | 25 | rcService arpwatch enable yes && \ |
michael@64 | 26 | arpwatch_usable="yes" |
michael@64 | 27 | rcService arpwatch enable yes && \ |
michael@64 | 28 | arpwatch_signal 0 && arpwatch_active="yes" |
michael@64 | 29 | echo "arpwatch_enable=\"$arpwatch_enable\"" |
michael@64 | 30 | echo "arpwatch_usable=\"$arpwatch_usable\"" |
michael@64 | 31 | echo "arpwatch_active=\"$arpwatch_active\"" |
michael@64 | 32 | |
michael@64 | 33 | %start -u @l_susr@ |
michael@64 | 34 | rcService arpwatch enable yes || exit 0 |
michael@64 | 35 | rcService arpwatch active yes && exit 0 |
michael@64 | 36 | @l_prefix@/sbin/arpwatch \ |
michael@64 | 37 | $arpwatch_iface \ |
michael@64 | 38 | $arpwatch_ipnet \ |
michael@64 | 39 | >$arpwatch_pidfile 2>&1 |
michael@64 | 40 | |
michael@64 | 41 | %stop -u @l_susr@ |
michael@64 | 42 | rcService arpwatch enable yes || exit 0 |
michael@64 | 43 | rcService arpwatch active no && exit 0 |
michael@64 | 44 | arpwatch_signal TERM |
michael@64 | 45 | |
michael@64 | 46 | %restart -u @l_susr@ |
michael@64 | 47 | rcService arpwatch enable yes || exit 0 |
michael@64 | 48 | rcService arpwatch active no && exit 0 |
michael@64 | 49 | rc arpwatch stop |
michael@64 | 50 | sleep 2 |
michael@64 | 51 | rc arpwatch start |
michael@64 | 52 | |
michael@64 | 53 | %reload -u @l_susr@ |
michael@64 | 54 | rcService arpwatch enable yes || exit 0 |
michael@64 | 55 | rcService arpwatch active no && exit 0 |
michael@64 | 56 | arpwatch_signal HUP |
michael@64 | 57 | |
michael@64 | 58 | %daily -u @l_susr@ |
michael@64 | 59 | rcService arpwatch enable yes || exit 0 |
michael@64 | 60 | shtool rotate -f \ |
michael@64 | 61 | -n ${arpwatch_log_numfiles} -s ${arpwatch_log_minsize} -d \ |
michael@64 | 62 | -z ${arpwatch_log_complevel} -o @l_susr@ -g @l_mgrp@ -m 644 \ |
michael@64 | 63 | -P "${arpwatch_log_prolog}" \ |
michael@64 | 64 | -E "${arpwatch_log_epilog}; rc arpwatch restart" \ |
michael@64 | 65 | @l_prefix@/var/arpwatch/log/arpwatch.log \ |
michael@64 | 66 | @l_prefix@/var/arpwatch/log/arpsnmp.log |