Kevin Grittner wrote:
> Due to a thread about the neglect of the sample start scripts I took a
> look at the current Linux file. There's certainly room for several
> improvements, but some of them might require discussion. Attached are
> a couple small changes which seem to me to be pretty tame. Hopefully
> a small, non-controversial step in the right direction.
>
> (1) It adds an LSB INIT INFO comment block, consistent with the
> chkconfig comment block above it.
>
> http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/initscrcomconv.html
>
> (2) It doesn't exit with zero for a missing executable unless the
> request is "stop". It uses 5, which means "program is not installed".
>
> http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
I applied a modified version of your script, attached. I also modified
the FreeBSD one to output a message, but it still returns 0.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do
+ If your life is a hard drive, Christ can be your backup. +
Index: contrib/start-scripts/linux
===================================================================
RCS file: /cvsroot/pgsql/contrib/start-scripts/linux,v
retrieving revision 1.10
diff -c -c -r1.10 linux
*** contrib/start-scripts/linux 11 Jan 2010 18:39:32 -0000 1.10
--- contrib/start-scripts/linux 23 Feb 2010 22:08:13 -0000
***************
*** 64,70 ****
set -e
# Only start if we can find the postmaster.
! test -x $DAEMON || exit 0
# Parse command line parameters.
case $1 in
--- 64,78 ----
set -e
# Only start if we can find the postmaster.
! test -x $DAEMON ||
! {
! echo "$DAEMON not found"
! if [ "$1" = "stop" ]
! then exit 0
! else exit 5
! fi
! }
!
# Parse command line parameters.
case $1 in