Comment 5 for bug 251330

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hi Andrew,

The policy is actually defined by the LSB:
 * http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

Quoting:
"If the status action is requested, the init script will return the following exit status codes.
  0 program is running or service is OK
  ..."

In the case of mythtv-status, it's not so much that the "program is running", but more that the "service is OK" or that it has run successfully.

I'm attaching another patch. Basically, I've edited the init script to touch a file, /var/run/mythtv-status, if it starts successfully, and remove that file if it does not start successfully, or it's stopped.

The 'status' action is then simply a test of that file's existence. Have a look at the updated patch attached.

:-Dustin