3 # snort Start/Stop the snort IDS daemon.
5 # chkconfig: 2345 40 60
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 ]; then
21 # nls "ERROR: Networking is down. %s can't be run." <service>
22 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
34 # show "Starting %s service." <service>
36 # we need full path here; see SnortUsersManual.pdf
37 daemon /usr/sbin/snort \
38 -u snort -g snort -s -d -D \
39 -l /var/log/snort -c /etc/snort/snort.conf
41 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/snort
43 # show "%s service is already running." <service>
44 msg_already_running snort
50 # show "Stopping %s service" <service>
51 if [ -f /var/lock/subsys/snort ]; then
55 rm -f /var/lock/subsys/snort
57 # show "%s service is not running." <service>
75 echo "Usage: $0 {start|stop|reload|restart|status}"