PostgreSQL init script wrongly returns 0 for "status" when no clusters are running

Bug #1076860 reported by Andreas Ntaflos
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postgresql-common (Debian)
Fix Released
Unknown
postgresql-common (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Because "set +e" is set in the "status" case of the postgresql init script, running "service postgresql status" or "/etc/init.d/postgresql status" always returns with exit code 0. Even when no clusters are running the exit code is 0, when it should really be 3, indicating that the service is not running (as per LSB specs). This has negative implications for Pacemaker, Puppet and other applications that expect init scripts to conform to LSB specifications.

Attached is a simple patch that removes "set +e" and makes the init script behave properly.

Tags: patch
Revision history for this message
Andreas Ntaflos (daff) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Remove "set +e" from init script so the "status" operation exits with the proper return codes of 0 when the service is running and 3 when it is not" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

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

This was fixed in version 135, and thus in raring.

affects: postgresql-9.1 (Ubuntu) → postgresql-common (Ubuntu)
Changed in postgresql-common (Ubuntu):
status: New → Fix Released
Changed in postgresql-common (Debian):
status: Unknown → 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.