root/psad/tags/psad-2.1.2/init-scripts/psad-init.redhat

Revision 1368, 1.3 kB (checked in by mbr, 4 years ago)

added ulogd data collection mode

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1 #!/bin/sh
2 #
3 # Startup script for psad
4 #
5 # chkconfig: 345 99 05
6 # description: The Port Scan Attack Detector (psad)
7 # processname: psad
8 # pidfile: /var/run/psad.pid
9 # config: /etc/psad/psad.conf
10 #
11 # $Id$
12
13 # Source function library.
14 . /etc/rc.d/init.d/functions
15
16 restart() {
17     $0 stop
18     $0 start
19 }
20
21 # See how we were called.
22 case "$1" in
23 start)
24     echo -n "Starting psad: "
25     ### psad enables signature matching and auto
26     ### danger level assignment by default, so
27     ### command line args are not necessary here.
28     daemon /usr/sbin/psad
29     RETVAL=$?
30     echo
31     if [ $RETVAL -eq 0 ]; then
32         touch /var/lock/subsys/psad
33     fi
34     ;;
35 stop)
36     echo -n "Shutting down the psad psadwatchd daemon: "
37         killproc psadwatchd
38         echo
39         echo -n "Shutting down the psad daemon: "
40         killproc psad
41     RETVAL=$?
42     [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/psad
43     echo
44     if [ -f /var/run/psad/kmsgsd.pid ]; then
45         echo -n "Shutting down the psad kmsgsd daemon: "
46         killproc kmsgsd
47         echo
48     fi
49     ;;
50 status)
51     if [ -f /var/run/psad/kmsgsd.pid ]; then
52         status kmsgsd
53     fi
54     status psad
55     status psadwatchd
56     ;;
57 restart|reload)
58     restart
59     ;;
60 condrestart)
61     [ -f /var/lock/subsys/psad ] && restart || :
62     ;;
63 *)
64     echo "Usage: psad {start|stop|status|restart|reload|condrestart}"
65     exit 1
66 esac
Note: See TracBrowser for help on using the browser.