Bug 752396 - RFE: pidfile cleanup
Summary: RFE: pidfile cleanup
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: systemd-RFE
TreeView+ depends on / blocked
 
Reported: 2011-11-09 11:54 UTC by Miroslav Lichvar
Modified: 2012-02-27 12:02 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-02-27 12:02:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Miroslav Lichvar 2011-11-09 11:54:02 UTC
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):
systemd-36-3.fc16.x86_64

Comment 1 Michal Schmidt 2011-11-09 15:01:26 UTC
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 09:21:00 UTC
Upstream commit to silence the warning in this case:
http://cgit.freedesktop.org/systemd/commit/?id=c5419d4239ceb4c3bd0263a0a810cf24a072b3c0

Comment 3 Jóhann B. Guðmundsson 2012-02-27 11:48:58 UTC
Is this still an issue or can this bug be closed?

Comment 4 Miroslav Lichvar 2012-02-27 11:58:31 UTC
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.