Your message dated Sun, 18 Feb 2018 15:52:07 +0000
with message-id <e1enrg3-0008gp...@fasolo.debian.org>
and subject line Bug#828769: fixed in pgpool2 3.7.2-1
has caused the Debian Bug report #828769,
regarding pgpool2: stale socket files after systemd kills pgpool processes 
duringstop
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
828769: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=828769
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: pgpool2
Version: 3.4.3-1
Severity: minor

Dear Maintainer,

I'm having an issue with stale pgpool2 socket files if systemd had killed the
pgpool processes while in progress of stopping pgpool2.

First of all, there is a systemd.service file for pgpool2 in
/lib/systemd/system/pgpool2.service. As it does not specify an explicit
ExecStop, default systemd.kill is used - first all pgpool processes will receive
a SIGTERM signal and, after a timeout of 90s, all remaining processes get a
final SIGKILL.

In my setups, sometimes stopping pgpool2 takes longer than the above mentioned
timeout (maybe long running SQL queries or so) - here SIGKILL kicks in. In
(rare) cases where pgpool somehow has locked up it may also refuse to kindly
exit cleanly - also here SIGKILL will used when trying to use systemd to stop
pgpool2. When the processes get killed hard, they will leave residues in
$socket_dir.

srwxrwxrwx 1 postgres postgres 0 Jun 23 07:02 /var/run/postgresql/.s.PGSQL.5432
srwxrwxrwx 1 postgres postgres 0 Jun 23 07:02 /var/run/postgresql/.s.PGSQL.9898

(On the next start|during a restart), pgpool2 will finally fail to start
claiming that the socket file(s) already exist(s). Like:

pgpool[7643]: [5-1] 2016-06-27 16:58:00: pid 7643: FATAL:  failed to bind a
   socket: "/var/run/postgresql/.s.PGSQL.9898"
pgpool[7643]: [5-2] 2016-06-27 16:58:00: pid 7643: DETAIL:  bind socket failed
   with error: "Address already in use"

As a first-aid I have added two ExecStartPre's to pgpool2.service that will
cleanup the sockets - if there is no more running pgpool process - before trying
to start pgpool2.

ExecStartPre=/bin/bash -c "{ /usr/bin/test -s /var/run/postgresql/pgpool.pid && 
! /usr/bin/pgrep --pidfile /var/run/postgresql/pgpool.pid; } || { /usr/bin/test 
! -s /var/run/postgresql/pgpool.pid && ! /usr/bin/pgrep pgpool; } && { 
/usr/bin/test -S /var/run/postgresql/.s.PGSQL.9898 && /bin/rm 
/var/run/postgresql/.s.PGSQL.9898; } || /usr/bin/test ! -S 
/var/run/postgresql/.s.PGSQL.9898"
ExecStartPre=/bin/bash -c "{ /usr/bin/test -s /var/run/postgresql/pgpool.pid && 
! /usr/bin/pgrep --pidfile /var/run/postgresql/pgpool.pid; } || { /usr/bin/test 
! -s /var/run/postgresql/pgpool.pid && ! /usr/bin/pgrep pgpool; } && { 
/usr/bin/test -S /var/run/postgresql/.s.PGSQL.5432 && /bin/rm 
/var/run/postgresql/.s.PGSQL.5432; } || /usr/bin/test ! -S 
/var/run/postgresql/.s.PGSQL.5432"

Rather hacky with the hardcoded socket filenames.  Otherwise IMHO 'port' and
'pcp_port' parameters from pgpool.conf needs to be looked up first to guess the
socket names.

My question - do you see a cleaner way to handle that situation?

-- System Information:
Debian Release: 8.5
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/3 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

--- End Message ---
--- Begin Message ---
Source: pgpool2
Source-Version: 3.7.2-1

We believe that the bug you reported is fixed in the latest version of
pgpool2, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 828...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Christoph Berg <m...@debian.org> (supplier of updated pgpool2 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 18 Feb 2018 12:52:30 +0100
Source: pgpool2
Binary: pgpool2 libpgpool0 libpgpool-dev postgresql-10-pgpool2
Architecture: source
Version: 3.7.2-1
Distribution: unstable
Urgency: medium
Maintainer: Debian PostgreSQL Maintainers 
<pkg-postgresql-public@lists.alioth.debian.org>
Changed-By: Christoph Berg <m...@debian.org>
Description:
 libpgpool-dev - pgpool control protocol library - headers
 libpgpool0 - pgpool control protocol library
 pgpool2    - connection pool server and replication proxy for PostgreSQL
 postgresql-10-pgpool2 - connection pool server and replication proxy for 
PostgreSQL - mod
Closes: 828769
Changes:
 pgpool2 (3.7.2-1) unstable; urgency=medium
 .
   * New upstream version.
   * Use SIGINT to stop service. Suggested by Gunnar Bluth, thanks!
     (Closes: #828769)
   * Move packaging repository to salsa.debian.org
Checksums-Sha1:
 e43333e95f9f7d0fe8a122a675783a351402990d 2636 pgpool2_3.7.2-1.dsc
 3f3d911cb4ddc46cada6f1ee7c7560c7f54b55d6 3249097 pgpool2_3.7.2.orig.tar.gz
 3e6ccb157626db33d5073d0122d0c247a3de81ac 12856 pgpool2_3.7.2-1.debian.tar.xz
 7a64a521d0b160b422e5ed70ddb8eaeb1d28f3b3 7858 pgpool2_3.7.2-1_source.buildinfo
Checksums-Sha256:
 ee2702cb78f0f019bd51012af8720853487363747999e9eceaecfd350f92bcb0 2636 
pgpool2_3.7.2-1.dsc
 f3f2825ccfdaa52f5e3d863bd43f1dc2ca37523a5f01b633db76596e73613ba4 3249097 
pgpool2_3.7.2.orig.tar.gz
 642ff5eaefca1d24cfcf0f96fcc8ad495334aef962954b2606f0f938436cb818 12856 
pgpool2_3.7.2-1.debian.tar.xz
 0b938b800dbe8fe79a398087326f0f1523f88677a7292168baf514b108a3b538 7858 
pgpool2_3.7.2-1_source.buildinfo
Files:
 d31e9cb2427f36371fb24e8df04bad3a 2636 database optional pgpool2_3.7.2-1.dsc
 52d5d5a7b9842d0077e50777be33a808 3249097 database optional 
pgpool2_3.7.2.orig.tar.gz
 95a049a10233aa0d189704ae9c28e02b 12856 database optional 
pgpool2_3.7.2-1.debian.tar.xz
 5cba99f5c6a49319e79f923391758d8a 7858 database optional 
pgpool2_3.7.2-1_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEXEj+YVf0kXlZcIfGTFprqxLSp64FAlqJatgACgkQTFprqxLS
p66BFQ/9GxTCQ5ty4cXHdA5FyqBMKvNmLtA6ZwQR3RsbdagTpBWnWsdOMLZZzYME
jzoDVwJjgbxSqDlCG1fXps9Ub9BmhRxYp9n/naV9peijsi+8WzsdQxZUX9vVCA3h
stEf/2U7f+F49rlhtrPqdW1ChTeFr6FKF4Dp5UuNMvI3fKp58EFbW5NVaAyg3xjn
BGGxZ8vqlqPSAmrZ7t7UhvBQiJ3ptpGDsoDU2ztcCW4JaQ0c+vkD6shV/M5vnP+Y
Zx90gAgokc2I5REDHODyciyLmBncHBXBW2gT+UjL/vEcxsZSfKB7DCwfw7tK1YlC
pBPS574OxJO/svqd9WHUJYtPFKNhD3DMXjQxjbdQi3CCT8bTTtjl3wJMTXlUYixX
lJbKEdi/t77c66VMwesmXqbRj+sxhSiIBSoA+FmcGvZ1wOa1KQtIVEtv+03Vp41Z
q2D9/RbRtMhTdMrOPSFBWHRPDCw9ydFBgctU2CPSWpKwsgwcHdKsTZFV2T6da/ru
mzhPlqrsOI/U8FZLAKCMShtfmCFPBgZnZszsNy5b+ALuL5DeJgmeUWegLLbnIAya
bNId/0X2W8V/Zn9WjGQE/xWDOoAYr5AG/Rz84IvnOAbm+BjXrmPMgOuukJ2RZCk/
znZBaS8bCzCOI46tc8FGlyaByPhptOH0soag5DQuVSF31BAcrsM=
=J1IP
-----END PGP SIGNATURE-----

--- End Message ---
_______________________________________________
Pkg-postgresql-public mailing list
Pkg-postgresql-public@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-postgresql-public

Reply via email to