Bug 197686 - postgresql init script report incorrect return value
Summary: postgresql init script report incorrect return value
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: postgresql
Version: 4.0
Hardware: All
OS: Linux
high
high
Target Milestone: ---
: ---
Assignee: Tom Lane
QA Contact: Kevin Baker
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: 243288
TreeView+ depends on / blocked
 
Reported: 2006-07-05 15:04 UTC by Marco Ceci
Modified: 2014-12-01 23:08 UTC (History)
4 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2012-06-20 13:30:06 UTC


Attachments (Terms of Use)
patch for the postgresql init script (1.92 KB, patch)
2006-07-05 15:04 UTC, Marco Ceci
no flags Details | Diff
another version of patch for postgresql-server's init script (2.11 KB, patch)
2006-12-06 07:55 UTC, Satoru SATOH
no flags Details | Diff
another patch for postgresql init script (2) (2.54 KB, patch)
2006-12-06 10:53 UTC, Satoru SATOH
no flags Details | Diff

Description Marco Ceci 2006-07-05 15:04:33 UTC
Description of problem:

The postgresql script does not return a failure value under some conditions. I
have currently tested two conditions:
   1) stop of postgresql service when the process is not active
   2) start of postgresql with a broken configuration
in both cases the init script report correctly a failure but return a value of 0
(which means success) instead of 1 (which means failure) 

Version-Release number of selected component (if applicable):

postgresql-7.4.13-2.RHEL4.1

How reproducible:

always

Steps to Reproduce:
1. 
# /etc/init.d/postgresql start
Starting postgresql service:                               [  OK  ]

2.
# killall -9 postmaster
#

3.
# /etc/init.d/postgresql stop
Stopping postgresql service:                               [FAILED]
# echo $?
0

Actual results:

return a value of 0 for a failure.

Expected results:

return a value 1 for a failure. This error makes unrealiable and possibly
dangerous the use of this script with programs that make decision based on this
return value, such as cluster suite.


Additional info:

I am attaching a simple patch that fix the problem.

Comment 1 Marco Ceci 2006-07-05 15:04:33 UTC
Created attachment 131935 [details]
patch for the postgresql init script

Comment 2 Satoru SATOH 2006-12-06 07:55:07 UTC
Created attachment 142927 [details]
another version of patch for postgresql-server's init script

Hi,

I have exactly the same problem and created a similar patch before checking
this BZ, while testing postgresql with cluster suite.

I attached my version of patch, just for the record. 
Perhaps, it might be helpful.

(Reference: LSB 3.1.0 core 
http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html)

Comment 3 Satoru SATOH 2006-12-06 10:53:40 UTC
Created attachment 142941 [details]
another patch for postgresql init script (2)

This patch contains some minor fixes and updates to treat the situation
mentioned in the LSB web page I referred in previous comment:

"""In addition to straightforward success, the following situations are also to
be considered successful:
    ...
    * running start on a service already running
    * running stop on a service already stopped or not running
    ...
"""

Comment 5 RHEL Product and Program Management 2008-02-01 19:13:08 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".

Comment 6 Tony Fu 2008-09-10 00:52:55 UTC
User mceci@redhat.com's account has been closed

Comment 7 RHEL Product and Program Management 2010-10-22 18:57:36 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 9 Jiri Pallich 2012-06-20 13:30:06 UTC
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. 
Please See https://access.redhat.com/support/policy/updates/errata/

If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.


Note You need to log in before you can comment on or make changes to this bug.