Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 671646 - dev-db/postgresql-10 with sys-apps/openrc - service shown as stopped when it is running after hard shutdown
Summary: dev-db/postgresql-10 with sys-apps/openrc - service shown as stopped when it ...
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-21 18:41 UTC by Nick Wiltshire
Modified: 2019-03-07 13:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Wiltshire 2018-11-21 18:41:49 UTC
After a hard shutdown of postgres, upon the next start you may see this in your log:

LOG: database system was interrupted; last known up at (timestamp)
LOG:  database system was not properly shut down; automatic recovery in progress

...

LOG:  database system is ready to accept connections

OpenRC sees this as Postgres not starting and rc-status will show postgresql-10 as [stopped].

This leads to postgres not getting shut down cleanly on the next boot cycle and we get stuck in a loop where the init system is forcing unclean shutdowns of the database every reboot, which triggers the above behavior over again.

There's also no apparent way to break out of the cycle except to manually stop the server with pg_ctl and restart it using OpenRC
Comment 1 Aaron W. Swenson gentoo-dev 2019-03-07 13:51:19 UTC
See: https://www.postgresql.org/docs/current/app-pg-ctl.html

The initscript is just a convenience wrapper around pg_ctl.

The only real fix here is for you to increase the START_TIMEOUT in /etc/conf.d/postgresql-${SLOT} to a reasonable and acceptable value for your machine. Historically, pg_ctl would hold for the entire timeout period which is why START_TIMEOUT is set to 10, but that has been changed at some point.

Still, even if we were to change the value to some larger number, this wouldn't be a "fix" as it may not be vary between systems, nor do I think it's okay to default to an indefinite hold up of the system in non-critical applications, such as on a laptop with GnuCash being the only application using PostgreSQL as it's backend.