service --status-all always reports upstart managed daemons as running

Bug #1582813 reported by James Page
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lsb (Ubuntu)
Fix Released
High
Steve Langasek
Trusty
Fix Released
High
Steve Langasek

Bug Description

[Impact]

This is a regression caused by the change to lsb-base that landed in -updates on the 12th of May:

lsb (4.1+Debian11ubuntu6.1) trusty; urgency=medium

  * Add 01-upstart-lsb from the upstart package and make
    executing rc.d scripts no-op if there is an upstart
    job for that script. (LP: #1273462)

 -- Zhang Hua <email address hidden> Thu, 06 Aug 2015 11:11:16 -0500

This changed the behaviour of init.d scripts to pass through to the associated upstart configuration for process management, where packages ship both an upstart configuration and an init.d configuration.

This has a rather nasty side effect on 'service --status-all', which calls the 'status' method on all installed init.d scripts - this gets translated into:

  status <service-name>

for upstart scripts, which correctly identifies the process as not running, but always returns a 0 return code. As a result, --status-all incorrectly identifies upstart processes as running even when they are not.

[Test Case]

1. On an installed trusty system, run this command to get a list of affected upstart jobs:
for job in $(initctl --system list | awk '/stop\/waiting/ {print $1}'); do if [ -x "/etc/init.d/$job" ]; then echo $job; fi; done

2. Check the status of this service in the output of service --status-all:
service --status-all 2>&1 | grep procps

3. Confirm that the service is shown as running, despite us knowing above that it is not:
 [ + ] procps

4. Install the lsb-base package from trusty-proposed.

5. Check the status of this service again in the output of service --status-all:
service --status-all 2>&1 | grep procps

6. Confirm that the service is no longer shown as running:
 [ - ] procps

[Regression Potential]

Minimal. This SRU updates the behavior of the lsb init script upstart diversion to implement LSB-compliant return values for the 'status' subcommand. It is possible this behavior change will differ from the original behavior of some init scripts, but that behavior was undefined.

Revision history for this message
James Page (james-page) wrote :
description: updated
tags: added: regression-update
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in lsb (Ubuntu):
status: New → Confirmed
Revision history for this message
James Page (james-page) wrote :

linked bug 1581171

impacts pretty much every openstack charm running on a trusty install.

Steve Langasek (vorlon)
Changed in lsb (Ubuntu):
assignee: nobody → Steve Langasek (vorlon)
importance: Undecided → High
status: Confirmed → Triaged
status: Triaged → In Progress
Steve Langasek (vorlon)
Changed in lsb (Ubuntu Trusty):
assignee: nobody → Steve Langasek (vorlon)
importance: Undecided → High
status: New → In Progress
Changed in lsb (Ubuntu):
status: In Progress → Fix Committed
Steve Langasek (vorlon)
description: updated
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello James, or anyone else affected,

Accepted lsb into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/lsb/4.1+Debian11ubuntu6.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in lsb (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lsb - 9.20160110ubuntu1

---------------
lsb (9.20160110ubuntu1) yakkety; urgency=medium

  * 01-upstart-lsb: when diverting an init script to an upstart job, we
    can't directly map the 'status' subcommand to /sbin/status because the
    return value of the latter is always 0 if we communicated successfully
    with upstart. Instead, parse the output of the command to correctly map
    this to the LSB return codes. LP: #1582813.

 -- Steve Langasek <email address hidden> Tue, 17 May 2016 17:04:06 -0700

Changed in lsb (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote : [lsb/trusty] verification still needed

The fix for this bug has been awaiting testing feedback in the -proposed repository for trusty for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now, the package will be removed from the -proposed repository.

tags: added: removal-candidate
Revision history for this message
Mathew Hodson (mhodson) wrote :

I verified that this bug affects procps on my Trusty system and the new lsb-base package fixes it.

$ ls -l /etc/init.d/procps
-rwxr-xr-x 1 root root 1192 May 27 2013 /etc/init.d/procps
$ initctl --system list | grep procps
procps stop/waiting
$ service --status-all 2>&1 | grep procps
 [ + ] procps

After installing lsb-base (4.1+Debian11ubuntu6.2), service --status-all correctly shows that procps is not running.

$ sudo dpkg -i lsb-base_4.1+Debian11ubuntu6.2_all.deb
(Reading database ... 197667 files and directories currently installed.)
Preparing to unpack lsb-base_4.1+Debian11ubuntu6.2_all.deb ...
Unpacking lsb-base (4.1+Debian11ubuntu6.2) over (4.1+Debian11ubuntu6.1) ...
Setting up lsb-base (4.1+Debian11ubuntu6.2) ...
$ initctl --system list | grep procps
procps stop/waiting
$ service --status-all 2>&1 | grep procps
 [ - ] procps

tags: added: verification-done
removed: removal-candidate verification-needed
Mathew Hodson (mhodson)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lsb - 4.1+Debian11ubuntu6.2

---------------
lsb (4.1+Debian11ubuntu6.2) trusty; urgency=medium

  * 01-upstart-lsb: when diverting an init script to an upstart job, we
    can't directly map the 'status' subcommand to /sbin/status because the
    return value of the latter is always 0 if we communicated successfully
    with upstart. Instead, parse the output of the command to correctly map
    this to the LSB return codes. LP: #1582813.

 -- Steve Langasek <email address hidden> Tue, 17 May 2016 17:07:10 -0700

Changed in lsb (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Update Released

The verification of the Stable Release Update for lsb has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.