5 # Required-Start: $local_fs $remote_fs $network
6 # Required-Stop: $local_fs $remote_fs $network
7 # Default-Start: 2 3 4 5
9 # Short-Description: Start PRADS sensor.
10 # Description: This script provides a packet level
11 # passive host and service detecion system
12 # in a chroot environment
14 #remember, for this to work out:
15 # groupadd -g 5505 prads
16 # useradd -g 5505 -u 5505 prads -h /var/run/prads -s /bin/false
17 # useradd -g 5505 -u 5505 prads -d /var/run/prads -s /bin/false
19 # Source function library
20 .
/lib
/lsb
/init-functions
23 DESC
="Passive Realtime Asset Detection System"
24 PATH
=/sbin
:/bin
:/usr
/sbin
:/usr
/bin
29 LOGFILE
=/var
/log
/prads-asset.log
31 PIDFILE
=$RUNDIR/$NAME.pid
32 HOME_NETS
="10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,fe80::/64"
33 PIDNAME
=$
(echo $PIDFILE|
sed "s@^$RUNDIR@@")
35 test -x $DAEMON ||
exit 0
41 # Include prads defaults if available
42 if [ -f /etc
/default
/prads
] ; then
45 DAEMON_OPTS
=${DAEMON_OPTS:--D -u $(id -u $USER) -g $(id -g $GROUP) -C $RUNDIR -l $LOGFILE -a $HOME_NETS -p $PIDNAME}
47 if [ -n "$INTERFACE" ]
49 DAEMON_OPTS
="$DAEMON_OPTS -i $INTERFACE"
55 output
=$
(/bin
/tempfile
-s.prads
)
56 log_daemon_msg
"Starting $DESC"
57 log_progress_msg
$NAME
58 if start-stop-daemon \
59 --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- \
60 ${DAEMON_OPTS} > ${output} 2>&1; then
70 log_daemon_msg
"Stopping $DESC"
71 log_progress_msg
$NAME
72 if start-stop-daemon \
73 --stop --quiet --pidfile $PIDFILE --retry 10 \
81 log_daemon_msg
"Reloading $DESC"
82 log_progress_msg
$NAME
90 status_of_proc
-p "${PIDFILE}" "${DAEMON}" "${NAME}"
97 log_success_msg
"Usage: $0 {start|stop|restart|force-reload}"