[cups-devel] Life time of CUPS subscriptions

Till Kamppeter till.kamppeter at gmail.com
Sat Jan 9 17:03:52 PST 2016


Hi,

I am working on a CUPS environment on mobile devices where the CUPS 
daemon is running on-demand, meaning that it is started by socket 
activation and stops after a certain time (30 or 60 seconds) of inactivity.

In the current CUPS, the scheduler is prevented from automatically 
shutting down if there are subscriptions from any applications. This is 
no problem if applications cancel the subscriptions when they are not 
needed any more. But in real life applications can crash (does not need 
to be a bug, can simply be caused by the user removing the battery) or 
they can have bugs, meaning that applications close leaving CUPS with 
stale subscriptions (entries in /etc/cups/subscriptions.conf).

In cups-browsed I plan to add a tracking mechanism so that cups-browsed 
can clean up in the next session after the crash.

But generally stale subscriptions can easily occur. So what I also want 
to do is to empty the /etc/cups/subscriptions.conf file during boot, 
before CUPS can be started for the first time, to remove all stale 
subscriptions from the last session.

Now my question is: Can I do this? Or are there applications creating 
subscriptions and expecting that they are still there after a reboot of 
the system? Or is it generally intended that if an application closes 
that it has to cancel all its CUPS subscriptions?

Would it be then perhaps even a good idea if the entries in 
subscriptions.conf had the requesters PID and CUPS checks from time to 
time whether the requester is still alive and cleans up if needed?

    Till



More information about the cups mailing list