File: psad-init

package info (click to toggle)
bastille 1%3A1.3.0-2.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,576 kB
  • ctags: 397
  • sloc: perl: 8,407; sh: 1,879; ansic: 638; makefile: 203; csh: 17
file content (66 lines) | stat: -rwxr-xr-x 1,395 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
#
# Startup script for psad
#
# chkconfig: 345 99 05
# description: The Port Scan Attack Detector (psad)
# processname: psad
# pidfile: /var/run/psad.pid
# config: /etc/psad/psad.conf 

# Source function library.
. /etc/rc.d/init.d/functions

restart() {
	$0 stop
	$0 start
}

# See how we were called.
case "$1" in
start)
	if grep -q psadfifo /etc/syslog.conf; then
		echo -n "Starting the psad daemons: "
		daemon /usr/sbin/psad -s /etc/psad/psad_signatures -a /etc/psad/psad_auto_ips
		RETVAL=$?
		echo
		if [ $RETVAL -eq 0 ]; then
			touch /var/lock/subsys/psad
		fi
	else
	        echo "Syslog has not been configured to send kern.info messages to"
       		echo "/var/log/psadfifo.  Do you need to run the psad installer?"
	fi
	;;
stop)
	echo -n "Shutting down the psadwatchd monitoring daemon: "
        killproc psadwatchd
        echo
        echo -n "Shutting down the psad daemon: "
        killproc psad
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/psad
	echo
	echo -n "Shutting down the kmsgs daemon: "
	killproc kmsgsd
	echo
	echo -n "Shutting down the disk monitoring daemon: "
	killproc diskmond
	echo
	;;
status)
	status kmsgsd
	status psad 
	status psadwatchd
	status diskmond
	;;
restart|reload)
	restart
	;;
condrestart)
	[ -f /var/lock/subsys/psad ] && restart || :
	;;
*)
	echo "Usage: psad {start|stop|status|restart|reload|condrestart}"
	exit 1
esac