[pgpool-general: 8321] Re: start/stop pgpool & postgres
Todd Stein
todd.stein at microfocus.com
Sat Jul 9 02:18:30 JST 2022
Ok thanks Jon,
I'll have a look.
Regards,
Todd Stein
-----Original Message-----
From: Jon SCHEWE <jon.schewe at raytheon.com>
Sent: Friday, July 8, 2022 12:50 PM
To: Todd Stein <todd.stein at microfocus.com>; Tatsuo Ishii <ishii at sraoss.co.jp>
Cc: pgpool-general at pgpool.net
Subject: Re: start/stop pgpool & postgres
> Starting and stopping postgres and pgpool.
> I've seen several posts and questions regarding the correct method to use for controlling postgres and pgpool. I'm referring to the use of pg_ctl, deamon mode/systemd, or other creative ways....
>
> The problem I've seen is that sometimes these methods do not remain in sync. You may start postgres with pg_ctl and get false results when running sysemctl status postgresql-<ver>.
>
> The pgpool scripts all use pg_ctl instead of systemd.
>
> Is one way better? Why?
I have recently been doing upgrades and digging into this and found that modifying the scripts to use systemctl and then granting postgres the ability to control the postgresql systemd unit directly has been a good way to go. This keeps it all in sync.
Put this in /etc/polkit-1/rules.d/60-manage-postgres-service.rules to allow postgres to control the systemd unit file.
// Allow postgres to manage postgres.service; // fall back to implicit authorization otherwise.
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.systemd1.manage-units" &&
action.lookup("unit") == "postgresql-14.service" &&
subject.user == "postgres") {
return polkit.Result.YES;
}
});
More information about the pgpool-general
mailing list