[Pgpool-hackers] pgpool.init patch
Yoshiyuki Asaba
y-asaba at sraoss.co.jp
Tue Apr 8 01:22:54 UTC 2008
Hi Devrim,
I received a redhat/pgpool.init patch.
- Honor /etc/sysconfig/pgpool settings. Previously we could never
customize PGPOOLPID=/var/run/pgpool.pid et al.
- Remaining hardcoded paths replaced by customizable variables
such as $PGPOOLCONF .
Could you check the attached patch?
Regards,
--
Yoshiyuki Asaba
y-asaba at sraoss.co.jp
-------------- next part --------------
--- redhat/pgpool.init.dist 2007-10-16 13:44:21.000000000 +0000
+++ redhat/pgpool.init 2008-04-07 07:20:01.000000000 +0000
@@ -9,10 +9,6 @@
# v1.0.0 Devrim GUNDUZ <devrim at CommandPrompt.com>
# - Initial version of Red Hat / Fedora init script
-if [ -r /etc/sysconfig/pgpool ]; then
- . /etc/sysconfig/pgpool
-fi
-
# Source function library.
INITD=/etc/rc.d/init.d
. $INITD/functions
@@ -37,16 +33,21 @@
PGPOOLPID=/var/run/pgpool.pid
PGPOOLLOG=/var/log/pgpool.log
+# read in the site custom setup
+if [ -r /etc/sysconfig/pgpool ]; then
+ . /etc/sysconfig/pgpool
+fi
+
test -x $PGPOOLDAEMON || exit 5
-# Create the log file if it does not exist
+# Create the pgpool.log log file if it does not exist
if [ ! -r $PGPOOLLOG ]
then
touch $PGPOOLLOG
fi
-# Check whether the config file exists or not
-if [ ! -r /etc/pgpool.conf ]
+# Check whether the pgpool.conf config file exists or not
+if [ ! -r "$PGPOOLCONF" ]
then
echo "$PGPOOLCONF not found"
RETVAL=1
@@ -82,7 +83,7 @@
RETVAL=1
failure
else
- killproc /usr/bin/pgpool
+ killproc $PGPOOLDAEMON
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/${NAME}
fi;
More information about the Pgpool-hackers
mailing list