Bug 42217 - restart'ing the service does not work
restart'ing the service does not work
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: postgresql (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-05-24 16:57 EDT by Enrico Scholz
Modified: 2007-04-18 12:33 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-05-29 11:20:45 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)

  None (edit)
Description Enrico Scholz 2001-05-24 16:57:54 EDT
Description of Problem:

1.

/etc/init.d/postgresql contains two if-statements

|                ...
|                pid=`pidof postmaster`
|                if [ $pid ]  # <-----
|                then

where $pid can contain multiple pids when restart'ing the service:

--- sh -x /etc/init.d/postgresql restart ----
| ++ pidof postmaster
| + pid=26406 26353
| + '[' 26406 26353 ']'
|/etc/init.d/postgresql: [: 26406: unary operator expected

So I get error-messages.

I suggest to quote the `$pid' term.


2.

Bug above shows only the symptoms of another bug: the `restart' command
executes `start' immediatily after `stop' without waiting for the service
to shutdown completely. There is a `sleep 2' in the stop function but it
seems not to be enough on my machine (K6/2-500).

pg_ctl knows a seperate `restart' command so I suggest to use it instead of
the `start; stop' sequence in the initscript. Alternatively the `-W' in

| su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -W stop"

could be omited if `stop' is called from `restart'


Steps to Reproduce:
1.   service postgresql start
2a. (produce some load to slow down machine)
2b. service postgresql restart

Actual Results:

Stopping postgresql service: postmaster successfully shut down

Checking postgresql installation:                                       [ 
OK  ]
/etc/init.d/postgresql: [: 27566: unary operator expected
Starting postgresql service:                                           
[FAILED]



Additional Information:
# rpm -q postgresql initscripts
postgresql-7.1.1-0.8
initscripts-5.86-1
Comment 1 Trond Eivind Glomsrxd 2001-05-29 11:20:41 EDT
Fixed in postgresql-7.1.2-1, coming soon to rawhide. The SRPM is, for a limited
time, available from http://people.redhat.com/teg/pg/

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