View Issue Details

IDProjectCategoryView StatusLast Update
0016684CentOS-7postgresqlpublic2019-11-01 11:18
Reporterkabe 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version7.7-1908 
Target VersionFixed in Version 
Summary0016684: postgresql fails to start/killed after timeout TimeoutSec=300 on start
DescriptionWhen starting postgresql via systemd unit, it seeems to be working for first 300 seconds,
but is terminated after that timeout.

$ rpm -q postgresql
postgresql-9.2.24-1.el7_5.x86_64
$ rpm -q systemd
systemd-219-67.el7_7.1.x86_64
Steps To Reproduce# yum install postgresql
# systemctl start postgresql
$ systemctl status -l postgresql
The service stays in "starting" state, and turns into "failed" and process killed after 300 seconds.
Additional Informationpostgresql forks into multiple processes;
systemd seems to try to guess the MAINPID, but fails, and does not acknowledge the finish of pg_ctl.

Workaround:
Add [Service] GuessMainPID=no for the unit description;
Drop in the following as /etc/systemd/system/postgresql.service.d/nomainpid.conf,
======
[Service]
GuessMainPID=no
======
# systemctl daemon-reload
# systemctl start postgresql
Now the service is deemed started.

Aren't there anyone suffering from this phenomenon?
TagsNo tags attached.
abrt_hash
URL

Activities

kabe

kabe

2019-11-01 11:18

reporter   ~0035625

Sample of failing example, for searching for the error keywords:

$ systemctl status -l postgresql
‚óŹ postgresql.service - PostgreSQL database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled)
   Active: failed (Result: timeout) since Fri 2019-11-01 20:17:20 JST; 5s ago
  Process: 1229 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=killed, signal=TERM)
  Process: 1180 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)

Nov 01 20:12:39 hostname systemd[1]: Starting PostgreSQL database server...
Nov 01 20:17:20 hostname systemd[1]: postgresql.service start operation timed out. Terminating.
Nov 01 20:17:20 hostname systemd[1]: Failed to start PostgreSQL database server.
Nov 01 20:17:20 hostname systemd[1]: Unit postgresql.service entered failed state.
Nov 01 20:17:20 hostname systemd[1]: postgresql.service failed.

Issue History

Date Modified Username Field Change
2019-11-01 11:02 kabe New Issue
2019-11-01 11:18 kabe Note Added: 0035625