Comment 21 for bug 1642966

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Robie, thanks for the investigations. I have looked into what the file /var/cache/cups/org.cups.cupsd (CUPS calls it "keepalive" file) is good for and what CUPS does with it. The file is created by the CUPS daemon cupsd when it needs to keep running, having active jobs, being in the course of a reload, having the web interface active or sharing printers, otherwise the file is removed. CUPS updates presence/no presence on start-up and shutdown of the daemon and it does exactly the same in both cases, so it can remain present after shutdown, depending on CUPS' configuration. CUPS never reads this file (or checks its presence), meaning that it is purely for advising external processes.

So for me it looks like that there is a certain system service manager (what one usually runs as PID 1 under Linux) which checks for the presence of keepalive files and decides based on this which daemons to kill and which to keep running.

I do not know everything about systemd. Does systemd care about keepalive files?

The CUPS upstream *.path makes cupsd being triggered by creating the file, but only if the file is not there already. What is this good for?

Does this *.path also take down cupsd if one removes the keepalive file or is systemd supposed to do so? For me cupsd does not get stopped by that.

And why does shutdown of CUPS fail after removing the keepalive file (with "Job for cups.service canceled.")? As CUPS does not care about it, systemd seems to depend on it. And what in the prerm script of the CUPS Debian package deletes the keepalive file?