systemd support: cups.path needs a "PartOf=cups.service" in the [Unit] section to assure clean shutdown of CUPS #4935

Closed
tillkamppeter opened this Issue Dec 19, 2016 · 3 comments

Comments

Projects
None yet
2 participants

The problem of the Ubuntu bug report

https://bugs.launchpad.net/ubuntu/+source/init-system-helpers/+bug/1642966

is not due of CUPS' keepalive file (Issue #4930) but needs a change in the cups.path unit file. The line "PartOf=cups.service" needs to be added to the [Unit] section, telling that cups.path belongs to CUPS (main unit cups.service) and so cups.path gets started/stopped/restarted whenever cups.service gets started/stopped/restarted.

This means that if cups,service gets stopped, cups.path gets stopped and so CUPS stays stopped and does not get re-triggered immediately by cups.path. On next boot everything gets started and so cups.path starts CUPS on the presence of the keepalive file.

So the cups.path file has to look like this:

[Unit]
Description=CUPS Scheduler
PartOf=cups.service

[Path]
PathExists=/var/cache/cups/org.cups.cupsd

[Install]
WantedBy=multi-user.target

@michaelrsweet michaelrsweet self-assigned this Dec 20, 2016

@michaelrsweet michaelrsweet added this to the 2.2 milestone Dec 20, 2016

Collaborator

michaelrsweet commented Dec 20, 2016

Scheduled for the next 2.2.x release.

Collaborator

michaelrsweet commented Jan 3, 2017

and that would be "PartOf=org.cups.cupsd.service" since we use org.cups.cupsd in the official CUPS sources. And I think we need this in the org.cups.cupsd.socket file as well...

[master 7852449] Update systemd config files (Issue #4935)

Collaborator

michaelrsweet commented Jan 3, 2017

(the pushed change also adds this to the org.cups.cups-lpd.socket file for the org.cups.cups-lpd.service)

mariospr added a commit to endlessm/eos-customer-support that referenced this issue Oct 19, 2017

Manually stop the cups.socket and cups.path units before stopping cups
This is necessary to prevent a bug that would make the 'stop cups'
command to fail in certain scenarios, still present in the version
on CUPS we have in 2.6.x (1.7.5).

See apple/cups#4935 for the upstream bug,
and https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1642966 for
additional details (originally reported by Ubuntu).

https://phabricator.endlessm.com/T19677
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment