]> git.ipfire.org Git - thirdparty/cups.git/commit
[Fedora] cups.service.in: Use 'notify' service type and run after network.target
authorZdenek Dohnal <zdohnal@redhat.com>
Wed, 25 Nov 2020 07:12:32 +0000 (08:12 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Wed, 25 Nov 2020 07:12:32 +0000 (08:12 +0100)
commite96e96b4bd0d4e6f634bbb66b95d6e475501541c
tree4874c42193f44e642cf9d7086ae1b56d7a8c1c0f
parentcd594c14220b3b8f7e8f854e3a9634ba61fba5e6
[Fedora] cups.service.in: Use 'notify' service type and run after network.target

1) If the service is defined with 'simple' type, the result of 'systemctl' is 0 regardless of actual startup result, because it reports success/failure of forking process (even before cupsd is started). This way errors due bad configuration or programming errors are masked during systemctl invocation.
The 'notify' type depends on executable sending a 'Im running' type of message to systemd after successful start and systemctl's return code depends whether this message came or not, which solves the issue.
2) The service needs to be started after all units needed for network.target are activated. This prevents starting cupsd before we have ports ready.

Fedora bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=1153660 (adding network.target)
https://bugzilla.redhat.com/show_bug.cgi?id=1088918 (change of the service type)
scheduler/cups.service.in
scheduler/main.c