3 # snort Start/Stop the snort IDS daemon.
5 # chkconfig: 2345 85 24
6 # description: snort is a lightweight network intrusion detection tool that \
7 # currently detects more than 1100 host and network \
8 # vulnerabilities, portscans, backdoors, and more.
11 # Source function library.
12 . /etc/rc.d/init.d/functions
13 . /etc/sysconfig/network
15 # Get service config - may override defaults
16 [ -f /etc/sysconfig/snort ] && . /etc/sysconfig/snort
18 # Check that networking is up.
19 if is_yes "${NETWORKING}"; then
20 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
21 msg_network_down snort
29 # See how we were called.
32 # Check if the service is already running?
33 if [ ! -f /var/lock/subsys/snort ]; then
35 # we need full path here; see SnortUsersManual.pdf
36 daemon /usr/sbin/snort \
37 -u snort -g snort -d -D \
38 -l /var/log/snort -c /etc/snort/snort.conf
40 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/snort
42 msg_already_running snort
46 if [ -f /var/lock/subsys/snort ]; then
50 rm -f /var/lock/subsys/snort
56 if [ -f /var/lock/subsys/snort ]; then
61 msg_not_running snort >&2
75 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"