[pgpool-hackers: 75] Re: pgpool-II fails to restart using redhat/pgpool.init

alex alex at smalldemons.com
Sat Jun 2 03:38:51 JST 2012


The change looks good, but it doesn't include what I added so the 
reload() function would also check the pcp.conf and pg_hba.conf.  It 
does a couple other things, too:
     - pg_hba.conf and pcp.conf are easy to relocate
     - reload uses "pgpool reload" instead of "killproc -HUP"

I've attached a diff with my changes applied to a version that includes 
your changes.


   alex

On 6/1/12 12:05 AM, Yugo Nagata wrote:
> Hello, Devrim
>
> I have fixed the pgpool.init to stop pgpool using by "pgpool stop -m f".
> Option '-m f' is meant to stop pgpool successfully even when connected
> from some frontend.
>
> In your original pgpool.init, stop() runs "pgpool stop&" as a
> background process (with '&'). (although it is commented out...)
> This allows new pgpool to start before old pgpool completely stop,
> so I removed '&'.
>
> I have attached the patch.
> Could you please review it?
>
> On Wed, 23 May 2012 18:56:51 -0400
> Devrim GÜNDÜZ<devrim at gunduz.org>  wrote:
>
>> Hi,
>>
>> I'm returning from a trip today, I'll look at it on Friday or Monday.
>> Still, I am not maintaining the init script in the tarball for a long
>> time. Instead, I'm maintaining
>>
>> http://svn.pgrpms.org/browser/rpm/redhat/9.1/pgpool-II/EL-6/pgpool.init
>>
>> (please reload the page if you get errors)
>>
>> I will review the version in the tarball, and send necessary fixes.
>>
>> Regards, Devrim
>>
>> On Thu, 2012-05-17 at 12:07 +0900, Yugo Nagata wrote:
>>> Dear Mr. Devrim
>>>
>>> An problem with restart using redhat/pgpool.init has been reported to the bug
>>> track.
>>> http://www.pgpool.net/mantisbt/view.php?id=12
>>>
>>> When pgpool is connected from frontend (e.g. psql), restart using
>>> redhat/pgpool.init fails with error like
>>> "bind(/tmp/.s.PGSQL.9898) failed. reason: Address already in use".
>>>
>>> There is no probrem when using `pgpool -m f stop; pgpool`.
>>> Would killproc fail to close the socket properly?
>>>
>>> I heard from Tatsuo Ishii that you are in charge of redhat/pgpool.init.
>>> Could you respond to the issue?
>>>
>>
>> -- 
>> Devrim GÜNDÜZ
>> Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
>> PostgreSQL Dan?s,man?/Consultant, Red Hat Certified Engineer
>> Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
>> http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz
>
>
>
> _______________________________________________
> pgpool-hackers mailing list
> pgpool-hackers at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-hackers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20120601/b2488ed1/attachment.html>
-------------- next part --------------
--- pgpool.init.old	2012-06-01 11:02:23.000000000 -0700
+++ pgpool.init	2012-06-01 11:35:07.000000000 -0700
@@ -54,6 +54,8 @@
 PGPOOLCONF=/etc/pgpool-II/pgpool.conf
 PGPOOLPIDDIR=/var/run/pgpool
 PGPOOLLOG=/var/log/pgpool.log
+PGPOOLHBA=""
+PGPOOLPCP=""
 
 test -x $PGPOOLDAEMON || exit 5
 
@@ -93,6 +95,8 @@
 	fi
 
 	PGPOOL_START=$"Starting ${NAME} service: "
+	[ -f "$PGPOOLHBA" ] && OPTS="$OPTS -a $PGPOOLHBA"
+	[ -f "$PGPOOLPCP" ] && OPTS="$OPTS -F $PGPOOLPCP"
 
 	echo -n "$PGPOOL_START"
 
@@ -155,12 +159,15 @@
 reload(){
 	echo -n $"Reloading ${NAME}: "
 
-	if [ -n "`pidfileofproc $PGPOOLDAEMON`" ] ; then
-		killproc $PGPOOLDAEMON -HUP
-	else
+        POPTS=""
+        [ -f "$PGPOOLHBA" ] && POPTS="$POPTS -a $PGPOOLHBA"
+        [ -f "$PGPOOLPCP" ] && POPTS="$POPTS -F $PGPOOLPCP"
+
+	$PGPOOLDAEMON -f $PGPOOLCONF $POPTS reload >> "$PGPOOLLOG" 2>&1 < /dev/null
+	RETVAL=$?
+	if [ $RETVAL -ne 0 ] ; then
 		failure $"Reloading ${NAME}"
 	fi
-	RETVAL=$?
 	echo
 }
 


More information about the pgpool-hackers mailing list