Menu

#3 Linux init script return codes

open
nobody
None
3
2015-02-26
2014-11-24
Brent Gerig
No

The Linux hsflowd init script returns 0 for all starts, stops, and statuses, and instead only prints the status. The lack of LSB-compliant return codes makes it difficult to script actions on the service. While it would be possible to modify the if/else lines to also return the proper codes, it would be ideal to rewrite the init script using the lsb init-functions. More info here: http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

Discussion

  • neil mckee

    neil mckee - 2014-11-25

    Agreed, and thanks for the pointers. This should be in the next release, and we are aiming to get that out before the end of next week.

    Neil

     
  • neil mckee

    neil mckee - 2014-12-08

    When you compile hsflowd for Debian (with "make deb") it installs an lsb-compliant /etc/init.d/hsflowd. On a Red Hat system I was hoping that installing the redhat-lsb package would allow it to use the same one, but there are still significant differences. So on Red Hat platforms (Fedora,CentOS,RHEL) it seems like we are expected to supply a redhat-specific /etc/init.d/hsflowd, and then build a redhat-specific rpm that uses it.

     
  • neil mckee

    neil mckee - 2015-02-26

    The latest release, 1_27_1, uses a redhat-specific initscript if it is compiled on a system with the /etc/redhat-release file present. While this is not the end of the story, I hope it addresses your needs in the short term.

    Neil

     

Log in to post a comment.