Bug 752396 - RFE: pidfile cleanup
RFE: pidfile cleanup
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
Depends On:
Blocks: systemd-RFE
  Show dependency treegraph
Reported: 2011-11-09 06:54 EST by Miroslav Lichvar
Modified: 2012-02-27 07:02 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-02-27 07:02:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Miroslav Lichvar 2011-11-09 06:54:02 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):
Comment 1 Michal Schmidt 2011-11-09 10:01:26 EST
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 :-)
Comment 2 Michal Schmidt 2011-11-10 04:21:00 EST
Upstream commit to silence the warning in this case:
Comment 3 Jóhann B. Guðmundsson 2012-02-27 06:48:58 EST
Is this still an issue or can this bug be closed?
Comment 4 Miroslav Lichvar 2012-02-27 06:58:31 EST
The pidfiles are not removed, but the warning is gone. I think this bug can be closed.

Note You need to log in before you can comment on or make changes to this bug.