[SRU]nut init script reports incorrect status

Bug #416182 reported by Clyde Clements
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nut (Ubuntu)
Fix Released
Undecided
Unassigned
Jaunty
Won't Fix
Undecided
Chuck Short

Bug Description

Binary package hint: nut

Ubuntu release: 9.04
Package: nut 2.4.1-2ubuntu4

When checking the status of nut with

  /etc/init.d/nut status

the script gave the output

  Checking status of Network UPS Tools
   * upsd is not running
   * upsmon is not running

even though both upsd and upsmon were indeed running as shown by the ps command.

I did some digging through the nut init script and found what I believe to be the problem. The script calls a function status_of_proc as follows:

  status_of_proc "$DESC" upsd

The first argument to that function should be the full pathname of the daemon. I recommend changing the above line to:

  status_of_proc $upsd upsd

Two other uses of the status_of_proc function in the init script regarding upsmon should be changed in a likewise manner.

Cheers,
Clyde

======

SRU Verification:

1. Install nut
2. Run the /etc/init.d/nut status script
3. Check to see if its running by comparing the output of ps auxwww | grep nut

Note: You should have a UPS to test this with.

Related branches

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

$ sudo /etc/init.d/nut status
Checking status of Network UPS Tools
 * upsd is not running
 * upsmon is not running
[3]

$ ps auxww|grep ups
nut 6701 0.0 0.0 14668 784 ? Ss 08:13 0:00 /lib/nut/usbhid-ups -a myups2
nut 6703 0.0 0.0 14472 640 ? Ss 08:13 0:00 /sbin/upsd
root 6705 0.0 0.0 14436 748 ? Ss 08:13 0:00 /sbin/upsmon
nut 6707 0.0 0.0 14436 716 ? S 08:13 0:00 /sbin/upsmon

Changed in nut (Ubuntu):
status: New → Confirmed
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

I should have mentioned I am using 2.4.1-3ubuntu1 on Ubuntu 9.10.

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

This bug was fixed in the package nut - 2.4.1-3ubuntu2

---------------
nut (2.4.1-3ubuntu2) karmic; urgency=low

  * debian/nut.init: Fix status_of_proc messages not to lie to
    the user. (LP: #416182)

 -- Chuck Short <email address hidden> Wed, 23 Sep 2009 09:37:16 -0400

Changed in nut (Ubuntu):
status: Confirmed → Fix Released
Chuck Short (zulcss)
Changed in nut (Ubuntu Jaunty):
assignee: nobody → Chuck Short (zulcss)
Revision history for this message
Chuck Short (zulcss) wrote :

Statement of Impact:

Jaunty was shipped with a bug that if the user tries to query the status of the nut daemons it, it returns the wrong information.

How to reproduce:

1. Install nut
2. Run the /etc/init.d/nut status script
3. Check to see if its running by comparing the output of ps auxwww | grep nut

There should be no regressions with this patch. If you have any questions please let me know.

Chuck Short (zulcss)
summary: - nut init script reports incorrect status
+ [SRU]nut init script reports incorrect status
Chuck Short (zulcss)
description: updated
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted nut into jaunty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in nut (Ubuntu Jaunty):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Martin Pitt (pitti) wrote :

Anyone who can test the proposed package? If not, the proposed update will be removed again. Thanks!

Revision history for this message
Chuck Short (zulcss) wrote :

Has anyone been able to test this yet?

Revision history for this message
Martin Pitt (pitti) wrote :

This update has been in jaunty-proposed for half a year or longer, without any testing feedback. I removed the jaunty-proposed package again.

Changed in nut (Ubuntu Jaunty):
status: Fix Committed → Won't Fix
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.