serivce --status-all reports ? for services that do support "status"

Bug #718013 reported by Chris Thomas (CTho)
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
sysvinit (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: sysvinit

I get a lot of question marks when I run "service --status-all", even for things that i know support status through the script in init.d. Some debugging:

$ lsb_release -rd
Description: Ubuntu 10.10
Release: 10.10

This doesn't work properly:

$ service --status-all 2>&1 | grep myth
 [ ? ] mythtv-backend

This is how it decides to print a question mark:
                        if ! grep -qs "\Wstatus)" "$SERVICE"; then

$ grep "\Wstatus)" mythtv-backend
$

But....

$ grep ^status mythtv-backend
status)
$

A quick hack fix:

$ diff -u `which service` /tmp/service
--- /usr/sbin/service 2010-11-01 11:36:01.000000000 -0500
+++ /tmp/service 2011-02-12 23:22:46.000000000 -0600
@@ -74,7 +74,7 @@
               *)
                 if ! is_ignored_file "${SERVICE}" \
       && [ -x "${SERVICEDIR}/${SERVICE}" ]; then
- if ! grep -qs "\Wstatus)" "$SERVICE"; then
+ if ! egrep -qs "\Wstatus\)|^status\)" "$SERVICE"; then
                           #printf " %s %-60s %s\n" "[?]" "$SERVICE:" "unknown" 1>&2
                           echo " [ ? ] $SERVICE" 1>&2
                           continue

New behavior:

$ /tmp/service --status-all 2>&1 | grep myth
 [ + ] mythtv-backend

Thanks. Hopefully this is enough info.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in sysvinit (Ubuntu):
status: New → Confirmed
Revision history for this message
Cassio Martini (cassiomartini) wrote :

I also get a lot of question marks, for things I would expect service should know about, as they come standard in Ubuntu, such as network-manager, ufw, etc.

Revision history for this message
Matthew Hillman (mhillman159) wrote :

I have quite a few question marks to things that I know are running, some of them are running through apps and some through command line start commands, both show as ? in the status.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.