[Pkg-postgresql-public] Bug#710275: postgresql needs restart on libc upgrade

Christoph Berg myon at debian.org
Fri Nov 3 18:59:49 UTC 2017


Control: severity -1 normal
Control: retitle -1 postgresql needs restart on libc/nss upgrade
Control: reassign -1 libc6
Control: affects -1 postgresql-common

Re: To Matthew Gabeler-Lee 2013-12-18 <20131218164859.GE22202 at msgid.df7cb.de>
> I've just tried the upgrade, and it is also there with "peer"
> authentication because that also goes through nss, so it has the same
> problem as the usual "pam upgrade needs to restart services":

> (base-wheezy-amd64.cow)root at pgdgbuild:/# sudo -u postgres psql
> psql: FATAL:  Peer authentication failed for user "postgres"
> 
> (base-wheezy-amd64.cow)root at pgdgbuild:/# cat /var/log/postgresql/postgresql-9.1-main.log
> ...
> 2013-12-18 16:42:47 UTC LOG:  local user with ID 101 does not exist
> 2013-12-18 16:42:47 UTC FATAL:  Peer authentication failed for user "postgres"

I've finally taken a closer look at the situation here. There is code
in libc6:amd64.preinst to restart services on upgrade, but I believe
the check is incomplete because it requires "postgresql" to be
installed, while the actual server package is called postgresql-9.6,
postgresql-10, etc. (the "postgresql" meta package is optional):

            check="kdm postgresql xdm"
            # NSS services check:
                    echo -n "Checking for services that may need to be restarted..."
            # Only get the ones that are installed, and configured
            check=$(dpkg -s $check 2> /dev/null | egrep '^Package:|^Status:' | awk '{if ($1 ~ /^Package:/) { package=$2 } else if ($0 ~ /^Status: .* installed$/) { print package }}')
            # some init scripts don't match the package names
            check=$(echo $check | \
                    sed -e's/\bapache2.2-common\b/apache2/g' \
                        -e's/\bat\b/atd/g' \
                        -e's/\bdovecot-common\b/dovecot/g' \
                        -e's/\bexim4-base\b/exim4/g' \
                        -e's/\blpr\b/lpd/g' \
                        -e's/\blpr-ppd\b/lpd-ppd/g' \
                        -e's/\bmysql-server\b/mysql/g' \
                        -e's/\bsasl2-bin\b/saslauthd/g' \
            )

What should work is to check for "postgresql-common" to be installed,
and then map the init script name back to "postgresql". This is what
libpam0g does, see libpam0g:amd64.postinst.

libc maintainers: could you implement that?

Thanks,
Christoph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-postgresql-public/attachments/20171103/76238641/attachment.sig>


More information about the Pkg-postgresql-public mailing list