* pipe expression was able to be used at "logfile".
authorHaruka harukat <harukat at sraoss.co.jp>
Wed, 4 Mar 2009 02:15:52 +0000 (02:15 +0000)
committerHaruka harukat <harukat at sraoss.co.jp>
Wed, 4 Mar 2009 02:15:52 +0000 (02:15 +0000)
e.g.
 "|logger -i"
 "|/usr/local/apache/bin/rotatelogs /var/log/pgpool 86400"

src/pgpool.in

index d973304821696ddff26ed0b640f173583ad0ae3b..1c27358069187ecefd75421f48f17acde3d0c15c 100755 (executable)
@@ -74,7 +74,11 @@ if [ "x$PCP_CONF" != 'x' ];then
 fi
 if [ "x$LOGFILE" != 'x' ];then
        PGPOOL="nohup $PGPOOL"
-       PGPOOL_START_ARG="$PGPOOL_START_ARG -d -n >>$LOGFILE 2>&1 &"
+    if [ $(echo $LOGFILE | cut -c 1) = '|' ]; then
+        PGPOOL_START_ARG="$PGPOOL_START_ARG -d -n 2>&1 $LOGFILE &"
+       else
+        PGPOOL_START_ARG="$PGPOOL_START_ARG -d -n >>$LOGFILE 2>&1 &"
+    fi
 fi
 
 PGPOOL_STOP_ARG=" stop"