FS#36616 - [postgresql] pid file clean up

Attached to Project: Arch Linux
Opened by Sergej Pupykin (sergej) - Tuesday, 20 August 2013, 17:12 GMT
Last edited by Dan McGee (toofishes) - Friday, 06 December 2013, 15:46 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Dan McGee (toofishes)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Sometimes after reboot postgres fails to start with

postgres[26823]: pg_ctl: invalid data in PID file "/var/lib/postgres/data/postmaster.pid"

"rm -f /var/lib/postgres/data/postmaster.pid" helps.

Probably "ExecStopPost=/bin/rm -f /var/lib/postgres/data/postmaster.pid" should be added to service file or pid file should be moved to /run somehow.
This task depends upon

Closed by  Dan McGee (toofishes)
Friday, 06 December 2013, 15:46 GMT
Reason for closing:  Won't fix
Additional comments about closing:  Fixed in systemd and not postgresql package.
Comment by Florian Pritz (bluewind) - Thursday, 29 August 2013, 12:55 GMT
I wonder why postgres doesn't remove the file itself and why it can't handle an empty file properly. When it's running there's lots of stuff in there so empty can only really mean it's not running, but I guess if someone really cares they'd have to ask upstream.

About that ExecStopPost: Having this pid file lying around will cause problems when a machine crashes so the better way would be to remove it once during boot rather than on shutdown IMHO.
Comment by Dan McGee (toofishes) - Monday, 09 September 2013, 23:33 GMT
Yeah, this seems odd and I don't know that I've never seen this on my machine. I would rather keep the pid file in the data directory since you can in theory have as many instances running as you want, and the pid file location reflects this.
Comment by Dan McGee (toofishes) - Saturday, 14 September 2013, 12:26 GMT
I believe systemd will handle this better now in 207? It sounds like it removes stale PID files now.
Comment by Dave Reisner (falconindy) - Saturday, 14 September 2013, 14:07 GMT

Loading...