Bug 197686 - postgresql init script report incorrect return value
postgresql init script report incorrect return value
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: postgresql (Show other bugs)
4.0
All Linux
high Severity high
: ---
: ---
Assigned To: Tom Lane
Kevin Baker
:
Depends On:
Blocks: 243288
  Show dependency treegraph
 
Reported: 2006-07-05 11:04 EDT by Marco Ceci
Modified: 2014-12-01 18:08 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 09:30:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Marco Ceci 2006-07-05 11:04:33 EDT
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 11:04:33 EDT
Created attachment 131935 [details]
patch for the postgresql init script
Comment 2 Satoru SATOH 2006-12-06 02:55:07 EST
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 05:53:40 EST
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 14:13:08 EST
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-09 20:52:55 EDT
User mceci@redhat.com's account has been closed
Comment 7 RHEL Product and Program Management 2010-10-22 14:57:36 EDT
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 09:30:06 EDT
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.