mythtv-status init script lacks the 'status' action

Bug #251330 reported by Dustin Kirkland  on 2008-07-24
4
Affects Status Importance Assigned to Milestone
mythtv-status (Ubuntu)
Wishlist
Unassigned

Bug Description

Binary package hint: mythtv-status

mythtv-status init script lacks the 'status' action. It would be useful to be able to determine if the status daemon is running or not by querying:
 * /etc/init.d/mythtv-status status

A concerted effort is being made to add status actions to many Ubuntu services' init scripts:
 * https://wiki.ubuntu.com/InitScriptStatusActions

:-Dustin

Dustin Kirkland  (kirkland) wrote :

Patch attached.

Please review/sponsor/upload.

:-Dustin

Changed in mythtv-status:
assignee: nobody → kirkland
importance: Undecided → Wishlist
status: New → In Progress
Andrew Ruthven (andrew-etc) wrote :

The status code that is being added to the init.d script is somewhat misleading. mythtv-status doesn't actually have a daemon to run...

Dustin Kirkland  (kirkland) wrote :

Good point. I looked a bit closer at the script itself, and I see now that the mythtv-status perl script does not operate in daemon mode.

I'm marking invalid and retracting my patch.

Thanks,
:-Dustin

Changed in mythtv-status:
assignee: kirkland → nobody
importance: Wishlist → Undecided
status: In Progress → Invalid
Andrew Ruthven (andrew-etc) wrote :

After a bit more consideration the status could report if the motd has been updated in the past x minutes if the ENABLE flag is set.

Would this be inline with the Ubuntu policy?

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

Changed in mythtv-status:
importance: Undecided → Wishlist
status: Invalid → In Progress
Changed in mythtv-status:
status: In Progress → Confirmed
Changed in mythtv-status:
status: Confirmed → Triaged
Luca Falavigna (dktrkranz) wrote :

Dustin, you're a MOTU now. I'll leave this upload to you and unsubscribe u-u-s, thanks!

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mythtv-status - 0.7.3-2ubuntu2

---------------
mythtv-status (0.7.3-2ubuntu2) intrepid; urgency=low

  * debian/control: Depend on lsb-base >= 3.2-14, providing status_of_proc().
  * debian/init.d: Add the 'status' action (LP: #251330).

 -- Dustin Kirkland <email address hidden> Mon, 06 Oct 2008 15:07:15 -0500

Changed in mythtv-status:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers