Fix logging, per report from Toshihiro Kitagawa.
authorDevrim GÜNDÜZ <devrim at gunduz.org>
Thu, 22 Oct 2009 11:52:33 +0000 (11:52 +0000)
committerDevrim GÜNDÜZ <devrim at gunduz.org>
Thu, 22 Oct 2009 11:52:33 +0000 (11:52 +0000)
redhat/pgpool.init
redhat/pgpool.sysconfig

index ee791c71ef07a26adba42774b38247bb3d700611..f09b982b68d5c460261d9ce9b8ab3838f1d9cecc 100755 (executable)
@@ -11,6 +11,9 @@
 #
 # v2.2 Devrim GUNDUZ <devrim@CommandPrompt.com>
 # - New and improved version which has some fixes.
+#
+# v2.2.5 Devrim GUNDUZ <devrim@CommandPrompt.com>
+# - 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"`
index ef8e2e1fce53a0bb1769e2a2f4779734b75b30c7..221869e597c6a2725178cda1adb4aeef56104b04 100644 (file)
@@ -4,3 +4,4 @@
 # -d: debug mode. lots of debug information will be printed
 
 #OPTS=" -d -n"
+OPTS=" -n"