Project

General

Profile

Actions

Bug #1610

closed

/etc/init.d/suricata status always returns 0

Added by Miguel Angel Cabrera Moya over 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

According to LSB specification status 0 is returned if the service is ok. But right now /etc/init.d/suricata status always returns 0
https://refspecs.linuxbase.org/LSB_3.1.0/LSB-generic/LSB-generic/iniscrptact.html

For my use case I just need a different value of 0 if something is not ok.

Actions #1

Updated by Victor Julien over 8 years ago

How did you install Suricata?

Actions #2

Updated by Miguel Angel Cabrera Moya over 8 years ago

I installed the package for Ubuntu 14.04 (Ubuntu Trusty) from this ppa https://launchpad.net/~oisf/+archive/ubuntu/suricata-beta/

Actions #3

Updated by Victor Julien over 8 years ago

  • Status changed from New to Assigned
  • Assignee set to Peter Manev
  • Target version set to Packaging/PPA
Actions #4

Updated by Peter Manev over 8 years ago

Interesting - the init script is very similar to the one in Debian.
I will update once I do some more investigation.

Actions #5

Updated by Jason Ish over 8 years ago

Peter asked me on IRC what the behaviour was like on Fedora/CentOS, as he wasn't around when I was able to answer I thought I would provide the answer here.

The RPMs no longer install anything in /etc/init.d, but you can use systemctl state suricata. If Suricata is running, systemctl will return 0, if Suricata is not running, systemctl status will return 3.

You can also use "service status suricata", that just forwards the request to systemctl and returns the same as systemctl status.

Actions #6

Updated by Peter Manev over 8 years ago

Apparently this is not true for Ubuntu/Debian for a number of valid reasons (with the later actually dropped the LSB support as of July 2015)

Ref and background:
https://en.wikipedia.org/wiki/Linux_Standard_Base#Limitations_on_Debian
https://wiki.debian.org/LSBInitScripts
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=208010

It seems Debian/Ubuntu have some deviations in the intention/rationale of the init script return codes.

Actions #7

Updated by Peter Manev almost 8 years ago

  • Status changed from Assigned to Closed
Actions

Also available in: Atom PDF