#
# 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
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
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"`