[Snort-devel] init script status check always exits zero

Josh Kline snort-devel at ...3556...
Wed Jan 28 23:33:26 EST 2015

It is my understanding that when asked to check status of a service an
init script should exit zero only when the service is running.


The Chef configuration management tool, for example, relies on this
behavior in order to conditionally start a service.
There is a work-around,

Currently `/etc/init.d/snortd status` always exits 0, regardless if snort
daemon is running, because it ignore the return value of the status

I am running version 1: of your snort.x86_64 rpm package.

Applying the following patch fixed the problem for me:

--- snortd.orig 2015-01-29 03:56:04.800894066 +0000
+++ snortd  2015-01-29 03:56:26.381132577 +0000
@@ -140,6 +140,8 @@
         status snort
+        RETVAL=$?
+        exit $RETVAL
         TC=125                          # Trailing context to grep

Thank you for your attention and for your work producing the Snort tool.

Josh Kline

More information about the Snort-devel mailing list