File: psad-init.redhat

package info (click to toggle)
psad 2.4.6-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 5,084 kB
  • sloc: perl: 13,976; ansic: 1,322; sh: 319; makefile: 18
file content (65 lines) | stat: -rwxr-xr-x 1,371 bytes parent folder | download | duplicates (5)
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
#!/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)
    echo -n "Starting psad: "
    ### psad enables signature matching and auto
    ### danger level assignment by default, so
    ### command line args are not necessary here.
    daemon /usr/sbin/psad
    RETVAL=$?
    echo
    if [ $RETVAL -eq 0 ]; then
        touch /var/lock/subsys/psad
    fi
    ;;
stop)
    echo -n "Shutting down the psad psadwatchd daemon: "
        killproc psadwatchd
        echo
        echo -n "Shutting down the psad daemon: "
        killproc psad
    RETVAL=$?
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/psad
    echo
    if [ -f /var/run/psad/kmsgsd.pid ]; then
        echo -n "Shutting down the psad kmsgsd daemon: "
        killproc kmsgsd
        echo
    fi
    ;;
status)
    if [ -f /var/run/psad/kmsgsd.pid ]; then
        status kmsgsd
    fi
    status psad
    status psadwatchd
    ;;
restart|reload)
    restart
    ;;
condrestart)
    [ -f /var/lock/subsys/psad ] && restart || :
    ;;
*)
    echo "Usage: psad {start|stop|status|restart|reload|condrestart}"
    exit 1
esac