Bug 752396

Summary: RFE: pidfile cleanup
Product: [Fedora] Fedora Reporter: Miroslav Lichvar <mlichvar>
Component: systemdAssignee: systemd-maint
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: johannbg, johannbg, lpoetter, metherid, mschmidt, notting, plautrba, systemd-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-27 12:02:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 784611    

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.