Subject: init script for pgpool

From: Andrew N Golovkov <[email-masked]>
Date: Mon, 14 Sep 2015 16:00:08 +0300

Can you fix init script for pgpool in repository?
In mainstream start/stop issues fixed 28.05.2014: 

> $SU -l $PGPOOLUSER -c "$PGPOOLDAEMON -f $PGPOOLCONF -m fast stop" >> "$PGPOOLLOG" 2>&1 < /dev/null

But yum repo have old init-script:

> killproc /usr/bin/pgpool

-- 
Sent via pgsql-pkg-yum mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-pkg-yum

---

From: Jeff Frost <[email-masked]>
Date: Mon, 14 Sep 2015 21:20:43 -0700

I'll take a look at this tomorrow. 

Sent from my iPhone

> On Sep 14, 2015, at 06:00, Andrew N Golovkov <[email-masked]> wrote:
>

---

From: Devrim GÜNDÜZ <[email-masked]>
Date: Tue, 15 Sep 2015 08:27:08 +0300

Hi Jeff,

> I'll take a look at this tomorrow. 

Thanks! For the records, upstream init script is here:

http://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/redh
at/pgpool.init;hb=HEAD

Regards,
-- 
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR

---

From: Jeff Frost <[email-masked]>
Date: Tue, 15 Sep 2015 17:28:49 -0700

So generally speaking we’ve diverged because we tack on the -<pgversion> number on the binary locations, so we can’t just grab the pgpool-2 community scripts and use them.  Do you think we need to do that? Is that so we can install multiple versions side by side?

> On Sep 14, 2015, at 10:27 PM, Devrim GÜNDÜZ <[email-masked]> wrote:
> 
> 
> Hi Jeff,
> 

---
Jeff Frost <[email-masked]>
CTO, PostgreSQL Experts, Inc.
Phone: 1-888-PG-EXPRT x506
FAX: 415-762-5122
http://www.pgexperts.com/

---

From: Devrim GÜNDÜZ <[email-masked]>
Date: Wed, 16 Sep 2015 11:25:59 +0300

Hi Jeff,

On Tue, 2015-09-15 at 17:28 -0700, Jeff Frost wrote:
> So generally speaking we’ve diverged because we tack on the 
> -<pgversion> number on the binary locations, so we can’t just grab
> the pgpool-2 community scripts and use them.  Do you think we need to
> do that? Is that so we can install multiple versions side by side?

I sent the link just for a reference to replace killproc --other than
that, you are correct. We will keep our script as is, except the bugs.

Cheers,

---

From: Jeff Frost <[email-masked]>
Date: Wed, 16 Sep 2015 08:18:13 -0700

> On Sep 16, 2015, at 01:25, Devrim GÜNDÜZ <[email-masked]> wrote:
> 
> 
> Hi Jeff,
> 

Ok, sounds good. I'll fix it up. I also want to fix the whitespace because it's mixed with different indentation levels. Do you have a preference for 2 or 4 space indents?

---

From: Devrim GÜNDÜZ <[email-masked]>
Date: Wed, 16 Sep 2015 20:17:52 +0300

Hi,

On Wed, 2015-09-16 at 08:18 -0700, Jeff Frost wrote:
> Ok, sounds good. I'll fix it up. I also want to fix the whitespace
> because it's mixed with different indentation levels. Do you have a
> preference for 2 or 4 space indents?

Nope, we don't have a policy.

Regards,

---

From: Jeff Frost <[email-masked]>
Date: Thu, 17 Sep 2015 11:38:32 -0700

Andrew, I’ve pushed updates to jf/pgpool_fixes branch in the pgrpms project.

Would you like to test the init script for us before we merge it to master?

> On Sep 14, 2015, at 6:00 AM, Andrew N Golovkov <[email-masked]> wrote:
> 

---

---

From: Andrew N Golovkov <[email-masked]>
Date: Fri, 18 Sep 2015 15:40:51 +0300

You forget $pidfile and $PGPOOLUSER and some more comments.

Check script in attach. I'm tested in my centos-6 and pgpool-II-92.

---

From: Jeff Frost <[email-masked]>
Date: Fri, 18 Sep 2015 10:17:50 -0700

Nice catch!  I found a couple other things as well, so here’s an updated version:

http://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob_plain;f=rpm/redhat/9.2/pgpool-II/EL-6/pgpool.init;hb=jf/pgpool_fixes_3

It seems to work in my vagrant, so let me know if it works for you and I’ll get it merged, then the next time we build, we’ll have it in the repo.

> On Sep 18, 2015, at 5:40 AM, Andrew N Golovkov <[email-masked]> wrote:
> 
> Check script in attach. I'm tested in my centos-6 and pgpool-II-92.<pgpool.init>
> -- 

---

---

From: Devrim Gündüz <[email-masked]>
Date: Fri, 18 Sep 2015 20:27:18 +0300

Hi Jeff,

Can you please update the changelog inside the script, too?

Cheers, Devrim

On September 18, 2015 8:17:50 PM GMT+03:00, Jeff Frost <[email-masked]> wrote:
>It seems to work in my vagrant, so let me know if it works for you and
>I’ll get it merged, then the next time we build, we’ll have it in the
>repo.
>
>

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

---

From: Jeff Frost <[email-masked]>
Date: Fri, 18 Sep 2015 10:33:15 -0700

Sure!  Do you think just v 2.4?

> On Sep 18, 2015, at 10:27 AM, Devrim Gündüz <[email-masked]> wrote:
> 
> Hi Jeff,
> 
> http://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob_plain;f=rpm/redhat/9.2/pgpool-II/EL-6/pgpool.init;hb=jf/pgpool_fixes_3 <http://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob_plain;f=rpm/redhat/9.2/pgpool-II/EL-6/pgpool.init;hb=jf/pgpool_fixes_3>
> 
>  http://www.postgresql.org/mailpref/pgsql-pkg-yum <http://www.postgresql.org/mailpref/pgsql-pkg-yum>
> 
> ---
> http://www.pgexperts.com <http://www.pgexperts.com/>/ 
> 
> 
> 
> 
> 
> -- 

---

---

From: Devrim GÜNDÜZ <[email-masked]>
Date: Fri, 18 Sep 2015 21:04:03 +0300

Hi,

> Sure!  Do you think just v 2.4?

Let's make it 3.4, so that it matches pgpool version as well.

Cheers,

---

From: Andrew N Golovkov <[email-masked]>
Date: Fri, 18 Sep 2015 22:23:45 +0300

You load /etc/sysconfig/pgpool file _before_ you set variables like PGPOOLUSER and other.
Also you set PGPOOLUSER but run commands with hardcoded `postgres' user:
> $SU -l postgres -c "$PGPOOLDAEMON -f $PGPOOLCONF $OPTS & " >> "$PGPOOLLOG" 2>&1 < /dev/null

Please, look at my script i'v posted today.

---

From: Jeff Frost <[email-masked]>
Date: Fri, 18 Sep 2015 13:44:57 -0700

> On Sep 18, 2015, at 12:23 PM, Andrew N Golovkov <[email-masked]> wrote:
> 

---

---

From: Andrew N Golovkov <[email-masked]>
Date: Sat, 19 Sep 2015 00:46:06 +0300

And again.

https://bpaste.net/show/20ee48a0fc81

Diff with your script and my (with little cosmetic changes from previous version).

---

From: Jeff Frost <[email-masked]>
Date: Fri, 18 Sep 2015 14:49:58 -0700

Could you use diff -b so it doesn’t show lines with just whitespace different?

> On Sep 18, 2015, at 2:46 PM, Andrew N Golovkov <[email-masked]> wrote:
> 
> And again.
> 

---

---

From: Andrew N Golovkov <[email-masked]>
Date: Sat, 19 Sep 2015 01:26:35 +0300

git diff -b: https://bpaste.net/show/89b37acb8f0a

Removed `switch' action, because not supported at least from 3.3.3, where init-script changed in upstream;

Every call stop/start/reload with correct calls and use variable `$PGPOOLUSER'
Removed unhandled arguments from `failure' and `success' function calls;
Cleanup useless commands and exit's.

Every line aligned with tabs;

Version in comment is 3.4 as proposed Devrim.

---

From: Jeff Frost <[email-masked]>
Date: Fri, 18 Sep 2015 16:00:11 -0700

This should address all your concerns:

> On Sep 18, 2015, at 3:26 PM, Andrew N Golovkov <[email-masked]> wrote:
> 

---

---

From: Andrew N Golovkov <[email-masked]>
Date: Sat, 19 Sep 2015 04:10:51 +0300

Awesome! Thanks!

---

From: Jeff Frost <[email-masked]>
Date: Fri, 18 Sep 2015 18:27:38 -0700

Merged.

It’ll show up in the repo the next time we build packages.

> On Sep 18, 2015, at 6:10 PM, Andrew N Golovkov <[email-masked]> wrote:
> 
> Awesome! Thanks!
> 

---

---

From: Devrim GÜNDÜZ <[email-masked]>
Date: Mon, 21 Sep 2015 17:14:42 +0300

Hi,

> Merged.

Thanks!
> It’ll show up in the repo the next time we build packages.

Just pushed them to 9.4, 9.3, 9.2 and 9.1 repos. Thanks again for the
patch.

Regards,