Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
michael@102 | 1 | #!@l_prefix@/bin/openpkg rc |
michael@102 | 2 | ## |
michael@102 | 3 | ## rc.nessus -- Run-Commands |
michael@102 | 4 | ## |
michael@102 | 5 | |
michael@102 | 6 | %config |
michael@102 | 7 | nessus_enable="$openpkg_rc_def" |
michael@102 | 8 | nessus_listen_addr="127.0.0.1" |
michael@102 | 9 | nessus_listen_port="1241" |
michael@102 | 10 | nessus_source_addr="127.0.0.1" |
michael@102 | 11 | nessus_log_prolog="true" |
michael@102 | 12 | nessus_log_epilog="true" |
michael@102 | 13 | nessus_log_numfiles="10" |
michael@102 | 14 | nessus_log_minsize="1M" |
michael@102 | 15 | nessus_log_complevel="9" |
michael@102 | 16 | |
michael@102 | 17 | %common |
michael@102 | 18 | nessus_pidfile="@l_prefix@/var/nessus/nessusd.pid" |
michael@102 | 19 | nessus_signal () { |
michael@102 | 20 | [ -f $nessus_pidfile ] && kill -$1 `cat $nessus_pidfile` |
michael@102 | 21 | } |
michael@102 | 22 | |
michael@102 | 23 | %status -u @l_susr@ -o |
michael@102 | 24 | nessus_usable="unknown" |
michael@102 | 25 | nessus_active="no" |
michael@102 | 26 | rcService nessus enable yes && \ |
michael@102 | 27 | nessus_signal 0 && nessus_active="yes" |
michael@102 | 28 | echo "nessus_enable=\"$nessus_enable\"" |
michael@102 | 29 | echo "nessus_usable=\"$nessus_usable\"" |
michael@102 | 30 | echo "nessus_active=\"$nessus_active\"" |
michael@102 | 31 | |
michael@102 | 32 | %start -p 900 -u @l_susr@ |
michael@102 | 33 | rcService nessus enable yes || exit 0 |
michael@102 | 34 | rcService nessus active yes && exit 0 |
michael@102 | 35 | @l_prefix@/sbin/nessusd \ |
michael@102 | 36 | --listen="${nessus_listen_addr}" \ |
michael@102 | 37 | --port="${nessus_listen_port}" \ |
michael@102 | 38 | --src-ip="${nessus_source_addr}" \ |
michael@102 | 39 | --background |
michael@102 | 40 | |
michael@102 | 41 | %stop -p 100 -u @l_susr@ |
michael@102 | 42 | rcService nessus enable yes || exit 0 |
michael@102 | 43 | rcService nessus active no && exit 0 |
michael@102 | 44 | nessus_signal TERM |
michael@102 | 45 | sleep 2 |
michael@102 | 46 | |
michael@102 | 47 | %restart -p 900 -u @l_susr@ |
michael@102 | 48 | rcService nessus enable yes || exit 0 |
michael@102 | 49 | rcService nessus active no && exit 0 |
michael@102 | 50 | rc nessus stop start |
michael@102 | 51 | |
michael@102 | 52 | %daily -u @l_susr@ |
michael@102 | 53 | rcService nessus enable yes || exit 0 |
michael@102 | 54 | shtool rotate -f \ |
michael@102 | 55 | -n ${nessus_log_numfiles} -s ${nessus_log_minsize} -d \ |
michael@102 | 56 | -z ${nessus_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ |
michael@102 | 57 | -P "${nessus_log_prolog}" \ |
michael@102 | 58 | -E "${nessus_log_epilog}; rc nessus restart" \ |
michael@102 | 59 | @l_prefix@/var/nessus/logs/nessusd.log |
michael@102 | 60 |