BUG #14288: sd_notify not called on startup using rhel RPMs

From: boris(dot)djurdjevic(at)postfinance(dot)ch
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14288: sd_notify not called on startup using rhel RPMs
Date: 2016-08-15 10:55:47
Message-ID: 20160815105547.30234.9196@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14288
Logged by: Boris Djurdjevic
Email address: boris(dot)djurdjevic(at)postfinance(dot)ch
PostgreSQL version: 9.6beta4
Operating system: RHEL 7.2
Description:

Hi there

We are using the following Version, installed from your YUM Repository:
Name : postgresql96-server
Arch : x86_64
Version : 9.6beta4
Release : 1PGDG.rhel7
Size : 18 M

On startup using "systemctl start postgresql-9.6" it comes to an timeout.
But this database instance is running and accepting connections (tested).
< 2016-08-15 10:54:28.040 CEST >LOG: database system was shut down at
2016-08-15 10:52:35 CEST
< 2016-08-15 10:54:28.043 CEST >LOG: MultiXact member wraparound
protections are now enabled
< 2016-08-15 10:54:28.046 CEST >LOG: database system is ready to accept
connections
< 2016-08-15 10:54:28.047 CEST >LOG: autovacuum launcher started

After "database system is ready to accept connections" there should be
sd_notify called, if I see it right. (see code at bottom)

It seams, that sd_notify is never called. The provided systemd.service is
using "Type=notify", which expects that sd_notify (or equivalent) is
called.
Aug 15 12:22:19 our-database-server systemd[1]: Starting PostgreSQL 9.6
database server...
Aug 15 12:22:19 our-database-server postmaster[7018]: < 2016-08-15
12:22:19.511 CEST >LOG: 00000: redirecting log output to logging collector
process
Aug 15 12:22:19 our-database-server postmaster[7018]: < 2016-08-15
12:22:19.511 CEST >HINT: Future log output will appear in directory
"pg_log".
Aug 15 12:22:19 our-database-server postmaster[7018]: < 2016-08-15
12:22:19.511 CEST >LOCATION: SysLogger_Start, syslogger.c:622
Aug 15 12:27:19 our-database-server systemd[1]: postgresql-9.6.service start
operation timed out. Terminating.
Aug 15 12:27:19 our-database-server systemd[1]: Failed to start PostgreSQL
9.6 database server.
Aug 15 12:27:19 our-database-server systemd[1]: Unit postgresql-9.6.service
entered failed state.
Aug 15 12:27:19 our-database-server systemd[1]: postgresql-9.6.service
failed.

Can it be, that systemd support is not compiled in:
djurdjevicb(at)our-database-server # strings /usr/pgsql-9.6/bin/postmaster |
grep "with-"
'--enable-rpath' '--prefix=/usr/pgsql-9.6'
'--includedir=/usr/pgsql-9.6/include' '--mandir=/usr/pgsql-9.6/share/man'
'--datadir=/usr/pgsql-9.6/share' '--enable-debug' '--enable-cassert'
'--with-perl' '--with-python' '--with-tcl' '--with-tclconfig=/usr/lib64'
'--with-openssl' '--with-pam' '--with-gssapi' '--with-includes=/usr/include'
'--with-libraries=/usr/lib64' '--enable-nls' '--enable-dtrace'
'--with-uuid=e2fs' '--with-libxml' '--with-libxslt' '--with-ldap'
'--with-selinux' '--with-system-tzdata=/usr/share/zoneinfo'
'--sysconfdir=/etc/sysconfig/pgsql' '--docdir=/usr/pgsql-9.6/doc'
'--htmldir=/usr/pgsql-9.6/doc/html' 'CFLAGS=-O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
--param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic
-DLINUX_OOM_ADJ=0' 'LDFLAGS=-Wl,--as-needed'

djurdjevicb(at)our-database-server # ldd /usr/pgsql-9.6/bin/* | grep system
djurdjevicb(at)our-database-server #

Looking at the source rpms postgresql-9.6.spec file I cannot find a reason
why "systemd_enabled" isn't active.
The RPM has also Requires defined to systemd-units, which seams good.

Is there anyone also experiencing the same problem?
Am I doing something wrong?

Kind Regards
- Boris

src/backend/postmaster/postmaster.c
2805 /* at this point we are really open for
business */
2806 ereport(LOG,
2807 (errmsg("database system is ready to
accept connections")));
2808
2809 #ifdef USE_SYSTEMD
2810 sd_notify(0, "READY=1");
2811 #endif
2812

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Devrim Gündüz 2016-08-15 11:37:14 Re: BUG #14288: sd_notify not called on startup using rhel RPMs
Previous Message Michael Paquier 2016-08-15 07:42:14 Re: BUG #14228: replication slot catalog_xmin not cleared on slot reuse