Bug 14152

Summary: cups: under systemd needs to use /run/cups as rundir
Product: [Build System, Metadata & Runtime] OE-Core Reporter: tf <tf+bugs.yocto>
Component: oe-core otherAssignee: Kai Kang <kai.kang>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: open.source, randy.macleod
Version: 3.1.4   
Target Milestone: 3.3 M4   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description tf 2020-12-11 10:29:24 UTC
Preconditions/Environment
-------------------------
dunfell image with systemd and cups

Triggering Action/Cause
-----------------------
Attempt to connect to cups daemon twice with sufficient time gap to allow it to exit (or close the daemon in between using systemctl).
 
Expectation
-----------
The cups daemon is supposed to auto-start every time.

Actual Result
-------------
The cups daemon will only auto-start on the first connection attempt.


Reproducibility
---------------
100%


The gist of it is that when running under systemd, cups needs to be configured with '--with-rundir=/run/cups', as systemd takes an exception to the activation socket being under /var/run and relocates it. This leads to fd duplication in cupsd and an inadvertent closure of the activation socket when the daemon exits due to inactivity, so that the daemon cannot be activated again.
Comment 2 Kai Kang 2021-02-24 07:16:02 UTC
Hi tf, Oleksandr,

I can not reproduce this failure. And I believe it has been fixed already by commit in master:

https://git.openembedded.org/openembedded-core/commit/meta/recipes-extended/cups?id=6c3f56020da7a26c2daea73e39c2f324f1f597db

cups: use /run instead /var/run in systemd's unit file
/var/run has been deprecated by systemd, so use /run instead,
as suggested by systemd.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

I'll ask @steve to cherry-pick it for dunfell.

Regards,
Kai
Comment 3 Kai Kang 2021-03-09 01:41:39 UTC
Sent cherry pick request for branch dunfell in oe-core maillist.