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.
1 #!@l_prefix@/bin/openpkg rc
2 ##
3 ## rc.nessus -- Run-Commands
4 ##
6 %config
7 nessus_enable="$openpkg_rc_def"
8 nessus_listen_addr="127.0.0.1"
9 nessus_listen_port="1241"
10 nessus_source_addr="127.0.0.1"
11 nessus_log_prolog="true"
12 nessus_log_epilog="true"
13 nessus_log_numfiles="10"
14 nessus_log_minsize="1M"
15 nessus_log_complevel="9"
17 %common
18 nessus_pidfile="@l_prefix@/var/nessus/nessusd.pid"
19 nessus_signal () {
20 [ -f $nessus_pidfile ] && kill -$1 `cat $nessus_pidfile`
21 }
23 %status -u @l_susr@ -o
24 nessus_usable="unknown"
25 nessus_active="no"
26 rcService nessus enable yes && \
27 nessus_signal 0 && nessus_active="yes"
28 echo "nessus_enable=\"$nessus_enable\""
29 echo "nessus_usable=\"$nessus_usable\""
30 echo "nessus_active=\"$nessus_active\""
32 %start -p 900 -u @l_susr@
33 rcService nessus enable yes || exit 0
34 rcService nessus active yes && exit 0
35 @l_prefix@/sbin/nessusd \
36 --listen="${nessus_listen_addr}" \
37 --port="${nessus_listen_port}" \
38 --src-ip="${nessus_source_addr}" \
39 --background
41 %stop -p 100 -u @l_susr@
42 rcService nessus enable yes || exit 0
43 rcService nessus active no && exit 0
44 nessus_signal TERM
45 sleep 2
47 %restart -p 900 -u @l_susr@
48 rcService nessus enable yes || exit 0
49 rcService nessus active no && exit 0
50 rc nessus stop start
52 %daily -u @l_susr@
53 rcService nessus enable yes || exit 0
54 shtool rotate -f \
55 -n ${nessus_log_numfiles} -s ${nessus_log_minsize} -d \
56 -z ${nessus_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \
57 -P "${nessus_log_prolog}" \
58 -E "${nessus_log_epilog}; rc nessus restart" \
59 @l_prefix@/var/nessus/logs/nessusd.log