nginx init script should support the 'status' action

Bug #251985 reported by Andres Rodriguez
6
Affects Status Importance Assigned to Milestone
nginx (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: nginx

nginx needs to have 'status' action on init script

Related branches

Changed in nginx:
assignee: nobody → andreserl
status: New → In Progress
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Attaching debdiff.

Changed in nginx:
status: In Progress → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nginx - 0.6.31-2ubuntu2

---------------
nginx (0.6.31-2ubuntu2) intrepid; urgency=low

  * debian/control: Add Depend on lsb >= 3.2-14, which has the
    status_of_proc() function.
  * debian/init.d:
    - Add sourcing to '. /lib/lsb/init-functions'
    - Add the 'status' action (LP: #251985).

 -- Andres Rodriguez <email address hidden> Fri, 25 Jul 2008 13:48:49 -0500

Changed in nginx:
status: Confirmed → Fix Released
Changed in nginx (Ubuntu):
status: Fix Released → Incomplete
Revision history for this message
Michael H. Oshita (ijinpublic+lp) wrote :

Calling the status action returns 4 (program or service is unknown) when the service is stopped.

This needs to return 3 (program is not running) to be LSB compatible in order to
function properly as a LSB Resource Agent in HA (heartbeat).

ref:
http://www.linux-ha.org/LSBResourceAgent

Revision history for this message
Daniel Hahler (blueyed) wrote :

First of all, "status" is not supported anymore in Karmic!
0.6.31-2ubuntu2 (which introduced this fix) is not mentioned in the current (0.7.59-1) changelog either, this looks like it got accidentally lost.

Then, about the patch from Michael, regarding the exit status on "status", it looks like a hack, to drop the "-p" (pidfile) param to status_of_proc (which likely has other side effects).

Andres, will you look into getting this fixed?

Changed in nginx (Ubuntu):
status: Incomplete → Triaged
importance: Undecided → Low
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hello Daniel,

Sure thing. I'll look into getting this fixed.

Changed in nginx (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Dear Daniel,

I'm attaching the debdiff for karmic, which is re adding the status action, and other changes to close bugs LP: #308695 and LP: #346010. Once this hit to karmic, I'll be requesting and SRU to fix the status action on Jaunty.

Would you please sponsor this upload? Thank you.

Andres.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

After doing some further testing and comparisons, dropping the "-p" (pidfile) param to status_of_proc() in karmic is not needed since it actually returns 3 (program is not running), when the service is stopped.

This seems to be a problem with Jaunty, because in jaunty it returns 4 (program or service is unknown) instead of 3 (program is not running). I've also seen this behaviour in other scripts, such as /etc/init.d/ssh and /etc/init.d/lighttpd.

Now, I'm guessing this could be a bug in LSB. I'll consult this issue with Dustin Kirkland to find the adequate solution for Jaunty. Meanwhile, please sponsor this upload.

Revision history for this message
Michael H. Oshita (ijinpublic+lp) wrote :

Andres,

Yes, that was the problem I was having in Jaunty, returning 4 instead of 3.
This makes heartbeat fail the monitor action.

I did have look at /lib/lsb/init-functions, but wasn't sure of the implications it would have
for other programs, so I referred to how status_of_proc was used (without the -p pidfile param)
 in atd and acpid under /etc/init.d/ and applied it to nginx.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hello Michael,

This problem is not actually with the nginx init script (or with the scripts of other packages). This is actually a problem of the /lib/lsb/init-functions script.

The problem here seems to be that in the latest update of lsb for Jaunty and Hardy ( 4.0-0), which is the same version in karmic, looks like that the init-functions script was not updated accordingly.

Something I've done to verify this, is that I've replaced the "init-functions" script (/lib/lsb/init-functions) in Jaunty, with the one provided in the Karmic package. By doing so, all init scripts returned 3 instead of 4. You could try this as well to verify the same thing. I'll be reporting a bug against to fix this in Jaunty.

Thanks for your report, which has lead us to find this bug.

Cheers

Changed in nginx (Ubuntu):
status: In Progress → Confirmed
assignee: Andres E. Rodriguez Lazo (andreserl) → nobody
Revision history for this message
Michael H. Oshita (ijinpublic+lp) wrote :

Hi Andres,

As you proposed, I tested Karmic's init-functions script by replacing it with Jaunty's, and this does indeed seem to fix the status problem I was encountering. Thanks for looking into this.

I'll be looking forward for a fix in Jaunty soon.

=)

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

This bug was fixed in the package nginx - 0.7.59-1ubuntu1

---------------
nginx (0.7.59-1ubuntu1) karmic; urgency=low

  * Readd status action to init script: (LP: #251985)
    - debian/init.d:
      + Add sourcing to '. /lib/lsb/init-functions'
      + Add 'status' action.
    - debian/control: Add Depend on lsb >= 3.2-14, which has the
      statuc_of_proc() function.
  * Added a UFW profile set: (LP: #308695)
    - debian/nginx.ufw.profile: Added.
    - debian/control: nginx: Suggests ufw.
    - debian/dirs: Added 'etc/ufw/applications.d'
    - debian/rules: Added install rule for the nginx UFW profile.
  * Added support for gzip_static module: (LP: #346010)
    - debian/rules: Added '--with-http_gzip_static_module' to configure.
  * debian/control: Update Maintainer field to match Ubuntu Developers.

 -- Andres Rodriguez <email address hidden> Tue, 04 Aug 2009 11:28:00 -0500

Changed in nginx (Ubuntu):
status: Confirmed → Fix Released
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.