[Pkg-postgresql-public] Bug#891234: postgresql-9.6: pg_ctlcluster suppresses to much information on startup

Albert Dengg albert at fsfe.org
Fri Feb 23 16:29:04 UTC 2018

Package: postgresql-9.6
Version: 9.6.6-0+deb9u1
Severity: normal


pg_ctlcluster, used by the startup script/systemd unit, suppresses the
output of the actual cluster startup.

however, this can lead to the situation where pg_ctlcluster tells you
that the startup failed and you should consult the logfile, however
there is no log entry because it could not open the log file.

when starting with strace, you can see that it actually tries to tell
you what the problem was, but the message gets eaten by the perl script:
strace -f /usr/bin/perl -wT /usr/bin/pg_ctlcluster --skip-systemctl-redirect 9.6-main start
[pid  2803] fcntl(10, F_SETFD, FD_CLOEXEC) = 0
[pid  2803] dup2(3, 0)                  = 0
[pid  2803] close(3)                    = 0
[pid  2803] open("/var/log/postgresql/postgresql-9.6-main.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EACCES (Permission denied)
[pid  2803] write(2, "/bin/sh: 1: ", 12) = 12
[pid  2803] write(2, "cannot create /var/log/postgresq"..., 76) = 76
[pid  2803] write(2, "\n", 1)           = 1
[pid  2803] dup2(10, 0)                 = 0
[pid  2803] close(10)                   = 0
[pid  2803] exit_group(2)               = ?

would it be possible not to completly supress the output of pg_ctl here,
as that a problem like in this case wrong permissions on the logfile (in
this case caused by logrotate and while running not a problem as logging
is done via syslog)


-- System Information:
Debian Release: 9.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

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

Versions of packages postgresql-9.6 depends on:
ii  libc6                  2.24-11+deb9u1
ii  libgssapi-krb5-2       1.15-1+deb9u1
ii  libldap-2.4-2          2.4.44+dfsg-5+deb9u1
ii  libpam0g               1.1.8-3.6
ii  libpq5                 9.6.6-0+deb9u1
ii  libssl1.1              1.1.0f-3+deb9u1
ii  libsystemd0            232-25+deb9u1
ii  libxml2                2.9.4+dfsg1-2.2+deb9u2
ii  locales                2.24-11+deb9u1
ii  postgresql-client-9.6  9.6.6-0+deb9u1
ii  postgresql-common      181+deb9u1
ii  ssl-cert               1.0.39
ii  tzdata                 2018c-0+deb9u1

Versions of packages postgresql-9.6 recommends:
ii  postgresql-contrib-9.6  9.6.6-0+deb9u1
ii  sysstat                 11.4.3-2

Versions of packages postgresql-9.6 suggests:
pn  locales-all  <none>

-- no debconf information

More information about the Pkg-postgresql-public mailing list