{"action":"created","issue":{"url":"https://api.github.com/repos/apple/cups/issues/4930","repository_url":"https://api.github.com/repos/apple/cups","labels_url":"https://api.github.com/repos/apple/cups/issues/4930/labels{/name}","comments_url":"https://api.github.com/repos/apple/cups/issues/4930/comments","events_url":"https://api.github.com/repos/apple/cups/issues/4930/events","html_url":"https://github.com/apple/cups/issues/4930","id":193123780,"number":4930,"title":"/lib/systemd/system/cups.path and keepalive file /var/cache/cups/org.cups.cupsd do not make sense with systemd","user":{"login":"tillkamppeter","id":1244825,"avatar_url":"https://avatars.githubusercontent.com/u/1244825?v=3","gravatar_id":"","url":"https://api.github.com/users/tillkamppeter","html_url":"https://github.com/tillkamppeter","followers_url":"https://api.github.com/users/tillkamppeter/followers","following_url":"https://api.github.com/users/tillkamppeter/following{/other_user}","gists_url":"https://api.github.com/users/tillkamppeter/gists{/gist_id}","starred_url":"https://api.github.com/users/tillkamppeter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tillkamppeter/subscriptions","organizations_url":"https://api.github.com/users/tillkamppeter/orgs","repos_url":"https://api.github.com/users/tillkamppeter/repos","events_url":"https://api.github.com/users/tillkamppeter/events{/privacy}","received_events_url":"https://api.github.com/users/tillkamppeter/received_events","type":"User","site_admin":false},"labels":[{"id":309213040,"url":"https://api.github.com/repos/apple/cups/labels/Third-Party","name":"Third-Party","color":"000000","default":false}],"state":"closed","locked":false,"assignee":{"login":"michaelrsweet","id":488103,"avatar_url":"https://avatars.githubusercontent.com/u/488103?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelrsweet","html_url":"https://github.com/michaelrsweet","followers_url":"https://api.github.com/users/michaelrsweet/followers","following_url":"https://api.github.com/users/michaelrsweet/following{/other_user}","gists_url":"https://api.github.com/users/michaelrsweet/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelrsweet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelrsweet/subscriptions","organizations_url":"https://api.github.com/users/michaelrsweet/orgs","repos_url":"https://api.github.com/users/michaelrsweet/repos","events_url":"https://api.github.com/users/michaelrsweet/events{/privacy}","received_events_url":"https://api.github.com/users/michaelrsweet/received_events","type":"User","site_admin":false},"assignees":[{"login":"michaelrsweet","id":488103,"avatar_url":"https://avatars.githubusercontent.com/u/488103?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelrsweet","html_url":"https://github.com/michaelrsweet","followers_url":"https://api.github.com/users/michaelrsweet/followers","following_url":"https://api.github.com/users/michaelrsweet/following{/other_user}","gists_url":"https://api.github.com/users/michaelrsweet/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelrsweet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelrsweet/subscriptions","organizations_url":"https://api.github.com/users/michaelrsweet/orgs","repos_url":"https://api.github.com/users/michaelrsweet/repos","events_url":"https://api.github.com/users/michaelrsweet/events{/privacy}","received_events_url":"https://api.github.com/users/michaelrsweet/received_events","type":"User","site_admin":false}],"milestone":null,"comments":11,"created_at":"2016-12-02T14:06:07Z","updated_at":"2016-12-04T21:19:26Z","closed_at":"2016-12-03T00:24:52Z","body":"During the investigation of whet causes this Ubuntu bug (most probably a systemd bug)\r\n\r\nhttps://bugs.launchpad.net/ubuntu/+source/init-system-helpers/+bug/1642966\r\n\r\nwe have found out that cupsd creates the empty file /var/cache/cups/org.cups.cupsd and otherwise removes it. It does this during startup and shutdown. AFAIK it is a keepalive file, probably only needed for Apple's launchd.\r\n\r\nThere is also a systemd unit file /lib/systemd/system/cups.path which starts CUPS when the /var/cache/cups/org.cups.cupsd file is newly created (not when it is already there). As there is nothing which creates this file outside CUPS, and systemd does not use keepalive files at all, and there are various more standard and more obvious methods on how to start CUPS. I do not see any sense in the /lib/systemd/system/cups.path file and on systemd systems I also do not see any sense in the /var/cache/cups/org.cups.cupsd file.\r\n\r\nSo my suggestions is:\r\n\r\n1. Do not create and take down /var/cache/cups/org.cups.cupsd in a systemd environment\r\n\r\n2. Remove /lib/systemd/system/cups.path or modify it that it starts CUPS on boot when there are pending jobs in /var/spool/cups/\r\n\r\nIf there is any intention behind /lib/systemd/system/cups.path and /var/cache/cups/org.cups.cupsd in systemd environments, please tell.\r\n"},"comment":{"url":"https://api.github.com/repos/apple/cups/issues/comments/264732040","html_url":"https://github.com/apple/cups/issues/4930#issuecomment-264732040","issue_url":"https://api.github.com/repos/apple/cups/issues/4930","id":264732040,"user":{"login":"tillkamppeter","id":1244825,"avatar_url":"https://avatars.githubusercontent.com/u/1244825?v=3","gravatar_id":"","url":"https://api.github.com/users/tillkamppeter","html_url":"https://github.com/tillkamppeter","followers_url":"https://api.github.com/users/tillkamppeter/followers","following_url":"https://api.github.com/users/tillkamppeter/following{/other_user}","gists_url":"https://api.github.com/users/tillkamppeter/gists{/gist_id}","starred_url":"https://api.github.com/users/tillkamppeter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tillkamppeter/subscriptions","organizations_url":"https://api.github.com/users/tillkamppeter/orgs","repos_url":"https://api.github.com/users/tillkamppeter/repos","events_url":"https://api.github.com/users/tillkamppeter/events{/privacy}","received_events_url":"https://api.github.com/users/tillkamppeter/received_events","type":"User","site_admin":false},"created_at":"2016-12-04T21:19:26Z","updated_at":"2016-12-04T21:19:26Z","body":"pitti, the intention is the following:\r\n\r\nIf CUPS is exiting and one of the following is true, CUPS needs to get restarted after the next boot:\r\n\r\n- Web interface active\r\n- At least one shared printer\r\n- Active jobs\r\n\r\nCUPS marks this by creating the empty keepalive file at a place where it survives the boot. If none of the criteria is true it removes the keepalive file (try by editing cupsd.conf). It does this in the following situations:\r\n\r\n- At startup (probably right after reading cupsd.conf), to assure the correct behavior on reboot after an unclean termination (crash, kill -9, ...).\r\n- At restart (kill -HUP, cupsctl operation, configuration change via web interface), to update with a configuration change.\r\n- At regular shutdown\r\n\r\nThe intention is that on boot with the keepalive file present, CUPS should be started as it has either to stay running permanently (printer sharing, web interface) or has to finish pending jobs. CUPS does not need to be started on boot otherwise.\r\n\r\nThis means that whenever there is this keepalive file the *.path has to start CUPS it CUPS is not already running, indpendent whether it is already there or newly created. If it is not there, *.path does not need to do anything. The current behavior is a bug in systemd.\r\n\r\nAnother bug in systemd is the shutdown problem of the original Ubuntu bug report.\r\n\r\nMike, can you assure that if there are no shared printers and the web interface is off, that as soon as a job appears that the keepalive file is created and as soon as CUPS runs out of jobs that the file is removed? This way on an unclean shutdown at any time and with corrected systemd CUPS would be immediately restarted if the system is still running or started on boot if the system had to be rebooted and so we get assured that the jobs get finished."}}
{"actor":{"display_login":"tillkamppeter"}}