SOURCES: pgpool.init - change uid:gid to pgpool:pgpool

radek radek at pld-linux.org
Tue Feb 24 13:46:39 CET 2009


Author: radek                        Date: Tue Feb 24 12:46:39 2009 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- change uid:gid to pgpool:pgpool

---- Files affected:
SOURCES:
   pgpool.init (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: SOURCES/pgpool.init
diff -u SOURCES/pgpool.init:1.3 SOURCES/pgpool.init:1.4
--- SOURCES/pgpool.init:1.3	Mon Jun 16 23:40:26 2008
+++ SOURCES/pgpool.init	Tue Feb 24 13:46:33 2009
@@ -14,6 +14,8 @@
 # Get network config
 . /etc/sysconfig/network
 
+PGPOOL_BIN=/usr/bin/pgpool
+
 # Get service config
 [ -f /etc/sysconfig/pgpool ] && . /etc/sysconfig/pgpool
 
@@ -37,11 +39,10 @@
 	if [ ! -f /var/lock/subsys/pgpool ]; then
 		msg_starting pgpool
 		rm -f $PGPOOLPID > /dev/null 2>&1
-		pgpool -f $PGPOOLCONF \
-			-a $PGPOOLHBA \
-			$OPTS >> $PGPOOLLOG 2>&1 #< /dev/null
+		start-stop-daemon -S -x $PGPOOL_BIN -c $PGPOOLUID:$PGPOOLGID \
+			-- -f $PGPOOLCONF -a $PGPOOLHBA $OPTS >> $PGPOOLLOG 2>&1
 		RETVAL=$?
-		pid_num=`pidof -s /usr/bin/pgpool`
+		pid_num=`pidof -s $PGPOOL_BIN`	# FIXME: this does not restrict the owner
 		if [ $pid_num ]; then
 			echo "Master PID number $pid_num" >> $PGPOOLLOG
 			echo -n $pid_num > $PGPOOLPID
@@ -51,7 +52,7 @@
 			RETVAL=1
 			fail
 		fi
-#		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pgpool
+		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pgpool
 	else
 		msg_already_running pgpool
 	fi
@@ -63,7 +64,7 @@
 	if [ -f /var/lock/subsys/pgpool ]; then
 		msg_stopping pgpool
 		busy
-		/usr/bin/pgpool stop >> $PGPOOLLOG 2>&1
+		$PGPOOL_BIN -f $PGPOOLCONF stop >> $PGPOOLLOG 2>&1
 		if [ $? -eq 0 ]; then
 			rm -f /var/lock/subsys/pgpool /var/run/pgpool.pid >/dev/null 2>&1
 			ok
@@ -80,7 +81,7 @@
 	if [ -f /var/lock/subsys/pgpool ]; then
 		msg_stopping pgpool
 		busy
-		/usr/bin/pgpool -m fast stop >> $PGPOOLLOG 2>&1
+		$PGPOOL_BIN -m fast stop >> $PGPOOLLOG 2>&1
 		if [ $? -eq 0 ]; then
 			rm -f /var/lock/subsys/pgpool /var/run/pgpool.pid >/dev/null 2>&1
 			ok
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/pgpool.init?r1=1.3&r2=1.4&f=u



More information about the pld-cvs-commit mailing list