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 # nls "ERROR: Networking is down. %s can't be run." <service>
22 msg_network_down snort
30 # See how we were called.
33 # Check if the service is already running?
34 if [ ! -f /var/lock/subsys/snort ]; then
35 # show "Starting %s service." <service>
37 # we need full path here; see SnortUsersManual.pdf
38 daemon /usr/sbin/snort \
39 -u snort -g snort -d -D \
40 -l /var/log/snort -c /etc/snort/snort.conf
42 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/snort
44 # show "%s service is already running." <service>
45 msg_already_running snort
49 if [ -f /var/lock/subsys/snort ]; then
51 # show "Stopping %s service" <service>
54 rm -f /var/lock/subsys/snort
60 if [ -f /var/lock/subsys/snort ]; then
65 # show "%s service is not running." <service>
66 msg_not_running snort >&2
80 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"