Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2421

When status is requested from the init script it should return 3 if the service is not running

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 3.9.0
    • Fix Version/s: 3.10.0
    • Component/s: None
    • Labels:
      None
    • Platform:
      Linux

      Description

      According to the LSB standards init scripts status should return 3 if the service is not running.

      http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

      For example the apache2 service works as expected:

      root@ubuntu-1404:/var/cfengine/masterfiles/lib# service apache2 status
       * apache2 is running
      root@ubuntu-1404:/var/cfengine/masterfiles/lib# echo $?
      0
      root@ubuntu-1404:/var/cfengine/masterfiles/lib# service apache2 stop
       * Stopping web server apache2                                                                                                           * 
      root@ubuntu-1404:/var/cfengine/masterfiles/lib# service apache2 status
       * apache2 is not running
      root@ubuntu-1404:/var/cfengine/masterfiles/lib# echo $?
      3
      

      But our init script returns zero regardless.

      root@ubuntu-1404:/var/cfengine/masterfiles/lib# service cfengine3 status
      cf-execd is not running
      cf-serverd is not running
      cf-monitord is not running
      root@ubuntu-1404:/var/cfengine/masterfiles/lib#  echo $?
      0
      root@ubuntu-1404:/var/cfengine/masterfiles/lib# service cfengine3 start
      Starting /var/cfengine/bin/cf-execd...
      Starting /var/cfengine/bin/cf-serverd...
      Starting /var/cfengine/bin/cf-monitord...
      root@ubuntu-1404:/var/cfengine/masterfiles/lib# service cfengine3 status
      cf-execd is running...
      cf-serverd is running...
      cf-monitord is running...
      root@ubuntu-1404:/var/cfengine/masterfiles/lib# echo $?
      0
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10042 Nick Anderson
                Reporter:
                a10042 Nick Anderson
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel