Bug 101927

Summary: Startup scripts read different configuration files on startup and shutdown
Product: [Retired] Red Hat Linux Reporter: Henning Schmiedehausen <hps>
Component: postgresqlAssignee: Fernando Nasser <fnasser>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 7.3.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-02-23 21:45:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Henning Schmiedehausen 2003-08-08 08:54:09 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030708

Description of problem:
The startup script for postgresql does the following unfortunate
(stupid) thing:

# Find the name of the script
NAME=`basename $0`
[...]
# Override defaults from /etc/sysconfig/pgsql if file is present
[ -f /etc/sysconfig/pgsql/${NAME} ] && . /etc/sysconfig/pgsql/${NAME}


Which means that restarting my database engine with

/sbin/service postgresql restart

reads /etc/sysconfig/pgsql/postgresql 

Regular Startup on boot reads /etc/sysconfig/pgsql/S85postgresql

and shutdown of the same engine (!) reads /etc/sysconfig/pgsql/K15postgresql

as configuration files for the postgresql engine.

This is ridiculous. Whoever wrote that script should be shot. This
might work under BSD where you always reference the script by the
same name but blindly copying into a SysV startup structure where
files are symlinked will not and can not work.


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

How reproducible:
Always

Steps to Reproduce:
1. Run sh -x /etc/init.d/postgresql start / stop
2. Run sh -x /etc/rc2.d/S85postgresql start
3. Run sh -x /etc/rc6.d/K15postgresql stop

compare the results. Have an /etc/sysconfig/pgsql/postgresql config
file and try again.
    

Actual Results:  
Database does not start on boot up. Database does not start correctly.
Database does not shut down on shutdown. Database gets corrupted.


Expected Results:  
Every official way to startup / shutdown the database should use the
same configuration files.

Additional info:

Comment 1 Andrew Overholt 2003-08-28 13:01:54 UTC
The init script is in the process of being overhauled.  This bug will be closed
when that work is completed.