From 607a37b5187226dd8e4d7d1e2e03e40ba9f0cb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Devrim=20G=C3=9CND=C3=9CZ?= Date: Thu, 22 Oct 2009 11:59:35 +0000 Subject: [PATCH] Fix logging, per report from Toshihiro Kitagawa. --- pgpool.init | 13 ++++++++++++- pgpool.sysconfig | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pgpool.init b/pgpool.init index ee791c7..f09b982 100755 --- a/pgpool.init +++ b/pgpool.init @@ -11,6 +11,9 @@ # # v2.2 Devrim GUNDUZ # - New and improved version which has some fixes. +# +# v2.2.5 Devrim GUNDUZ +# - Fix logging. if [ -r /etc/sysconfig/pgpool ]; then . /etc/sysconfig/pgpool @@ -37,6 +40,14 @@ then NAME=${NAME:3} fi +# For SELinux we need to use 'runuser' not 'su' +if [ -x /sbin/runuser ] +then + SU=runuser +else + SU=su +fi + # Set defaults for configuration variables PGPOOLENGINE=/usr/bin PGPOOLDAEMON=$PGPOOLENGINE/pgpool @@ -85,7 +96,7 @@ start(){ echo -n "$PGPOOL_START" - $PGPOOLDAEMON -f $PGPOOLCONF $OPTS & >> "$PGPOOLLOG" 2>&1 < /dev/null + $SU -l postgres -c "$PGPOOLDAEMON -f $PGPOOLCONF $OPTS & " >> "$PGPOOLLOG" 2>&1 < /dev/null sleep 2 pid=`pidof -s "$PGPOOLDAEMON"` diff --git a/pgpool.sysconfig b/pgpool.sysconfig index ef8e2e1..221869e 100644 --- a/pgpool.sysconfig +++ b/pgpool.sysconfig @@ -4,3 +4,4 @@ # -d: debug mode. lots of debug information will be printed #OPTS=" -d -n" +OPTS=" -n"