Red Hat Bugzilla – Bug 752396
RFE: pidfile cleanup
Last modified: 2012-02-27 07:02:59 EST
Description of problem:
Services which drop root privileges on start (from the packages I maintain it's ntpd, gpsd, chronyd) are unable to remove their pidfiles on exit and if the systemd service has the PIDFile directive, systemd will log:
PID * read from file * does not exist. Your service or init script might be broken.
Would it make sense to remove the pidfiles in systemd when the service was successfully stopped? Or at least don't log the warning if the PID is the one that was already killed by systemd?
Version-Release number of selected component (if applicable):
I'll remove the warning in the case when we're trying to read the PID file from service_sigchld_event(). When I added it, I did not consider the possibility that the daemon may not have the rights to remove its pidfile. I'll keep the warning for the cases when we're reading the pidfile after service start.
And yes, I suppose systemd could remove the pidfile when the service stops.
In the long run, please convert the services away from Type=forking and no pidfiles will be needed anymore :-)
Upstream commit to silence the warning in this case:
Is this still an issue or can this bug be closed?
The pidfiles are not removed, but the warning is gone. I think this bug can be closed.