* [PATCH] cups: set rundir to /run/cups if systemd is used
@ 2021-02-21 16:49 Oleksandr Kravchuk
2021-02-21 16:51 ` Oleksandr Kravchuk
2021-02-21 17:00 ` [OE-core] " Khem Raj
0 siblings, 2 replies; 4+ messages in thread
From: Oleksandr Kravchuk @ 2021-02-21 16:49 UTC (permalink / raw)
To: openembedded-core; +Cc: kai.kang, Oleksandr Kravchuk
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.
[YOCTO #14152]
Signed-off-by: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>
---
meta/recipes-extended/cups/cups.inc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/meta/recipes-extended/cups/cups.inc b/meta/recipes-extended/cups/cups.inc
index e7a704134c..a8e8d115da 100644
--- a/meta/recipes-extended/cups/cups.inc
+++ b/meta/recipes-extended/cups/cups.inc
@@ -56,8 +56,11 @@ EXTRA_OECONF = " \
--enable-libusb \
--with-domainsocket=/run/cups/cups.sock \
DSOFLAGS='${LDFLAGS}' \
+ ${EXTRA_OECONF_SYSTEMD} \
"
+EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-rundir=/run/cups','',d)}"
+
EXTRA_AUTORECONF += "--exclude=autoheader"
do_compile () {
@@ -105,6 +108,8 @@ RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps',
FILES_${PN} += "${libexecdir}/cups/ \
"
+FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '/run/cups/certs', '', d)}"
+
FILES_${PN}-lib = "${libdir}/libcups.so.*"
FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*"
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] cups: set rundir to /run/cups if systemd is used
2021-02-21 16:49 [PATCH] cups: set rundir to /run/cups if systemd is used Oleksandr Kravchuk
@ 2021-02-21 16:51 ` Oleksandr Kravchuk
2021-02-22 1:41 ` kai
2021-02-21 17:00 ` [OE-core] " Khem Raj
1 sibling, 1 reply; 4+ messages in thread
From: Oleksandr Kravchuk @ 2021-02-21 16:51 UTC (permalink / raw)
To: openembedded-core; +Cc: kai.kang
Kai -
Could you please verify and confirm the fix is correct?
On 21/02/2021 17:49, Oleksandr Kravchuk wrote:
> 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.
>
> [YOCTO #14152]
>
> Signed-off-by: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>
> ---
> meta/recipes-extended/cups/cups.inc | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/meta/recipes-extended/cups/cups.inc b/meta/recipes-extended/cups/cups.inc
> index e7a704134c..a8e8d115da 100644
> --- a/meta/recipes-extended/cups/cups.inc
> +++ b/meta/recipes-extended/cups/cups.inc
> @@ -56,8 +56,11 @@ EXTRA_OECONF = " \
> --enable-libusb \
> --with-domainsocket=/run/cups/cups.sock \
> DSOFLAGS='${LDFLAGS}' \
> + ${EXTRA_OECONF_SYSTEMD} \
> "
>
> +EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-rundir=/run/cups','',d)}"
> +
> EXTRA_AUTORECONF += "--exclude=autoheader"
>
> do_compile () {
> @@ -105,6 +108,8 @@ RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps',
> FILES_${PN} += "${libexecdir}/cups/ \
> "
>
> +FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '/run/cups/certs', '', d)}"
> +
> FILES_${PN}-lib = "${libdir}/libcups.so.*"
>
> FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*"
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [OE-core] [PATCH] cups: set rundir to /run/cups if systemd is used
2021-02-21 16:49 [PATCH] cups: set rundir to /run/cups if systemd is used Oleksandr Kravchuk
2021-02-21 16:51 ` Oleksandr Kravchuk
@ 2021-02-21 17:00 ` Khem Raj
1 sibling, 0 replies; 4+ messages in thread
From: Khem Raj @ 2021-02-21 17:00 UTC (permalink / raw)
To: Oleksandr Kravchuk
Cc: Patches and discussions about the oe-core layer, Kang Kai
On Sun, Feb 21, 2021 at 8:49 AM Oleksandr Kravchuk
<open.source@oleksandr-kravchuk.com> wrote:
>
> 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.
>
> [YOCTO #14152]
>
> Signed-off-by: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>
> ---
> meta/recipes-extended/cups/cups.inc | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/meta/recipes-extended/cups/cups.inc b/meta/recipes-extended/cups/cups.inc
> index e7a704134c..a8e8d115da 100644
> --- a/meta/recipes-extended/cups/cups.inc
> +++ b/meta/recipes-extended/cups/cups.inc
> @@ -56,8 +56,11 @@ EXTRA_OECONF = " \
> --enable-libusb \
> --with-domainsocket=/run/cups/cups.sock \
> DSOFLAGS='${LDFLAGS}' \
> + ${EXTRA_OECONF_SYSTEMD} \
> "
>
> +EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-rundir=/run/cups','',d)}"
> +
> EXTRA_AUTORECONF += "--exclude=autoheader"
>
> do_compile () {
> @@ -105,6 +108,8 @@ RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps',
> FILES_${PN} += "${libexecdir}/cups/ \
> "
>
> +FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '/run/cups/certs', '', d)}"
> +
/run dir is created/populated during runtime. you can use tmpfile
fragment in do_install something like
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true',
'false', d)}; then
install -d ${D}${sysconfdir}/tmpfiles.d
echo "d /run/cups/cert 0755 - - - -" >
${D}${sysconfdir}/tmpfiles.d/cups.conf
fi
> FILES_${PN}-lib = "${libdir}/libcups.so.*"
>
> FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*"
> --
> 2.25.1
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cups: set rundir to /run/cups if systemd is used
2021-02-21 16:51 ` Oleksandr Kravchuk
@ 2021-02-22 1:41 ` kai
0 siblings, 0 replies; 4+ messages in thread
From: kai @ 2021-02-22 1:41 UTC (permalink / raw)
To: Oleksandr Kravchuk, openembedded-core
On 2/22/21 12:51 AM, Oleksandr Kravchuk wrote:
> Kai -
>
> Could you please verify and confirm the fix is correct?
OK. I'll test the v2 patch.
Regards,
Kai
>
> On 21/02/2021 17:49, Oleksandr Kravchuk wrote:
>> 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.
>>
>> [YOCTO #14152]
>>
>> Signed-off-by: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>
>> ---
>> meta/recipes-extended/cups/cups.inc | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/meta/recipes-extended/cups/cups.inc
>> b/meta/recipes-extended/cups/cups.inc
>> index e7a704134c..a8e8d115da 100644
>> --- a/meta/recipes-extended/cups/cups.inc
>> +++ b/meta/recipes-extended/cups/cups.inc
>> @@ -56,8 +56,11 @@ EXTRA_OECONF = " \
>> --enable-libusb \
>> --with-domainsocket=/run/cups/cups.sock \
>> DSOFLAGS='${LDFLAGS}' \
>> + ${EXTRA_OECONF_SYSTEMD} \
>> "
>> +EXTRA_OECONF_SYSTEMD =
>> "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-rundir=/run/cups','',d)}"
>> +
>> EXTRA_AUTORECONF += "--exclude=autoheader"
>> do_compile () {
>> @@ -105,6 +108,8 @@ RDEPENDS_${PN} +=
>> "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps',
>> FILES_${PN} += "${libexecdir}/cups/ \
>> "
>> +FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd',
>> '/run/cups/certs', '', d)}"
>> +
>> FILES_${PN}-lib = "${libdir}/libcups.so.*"
>> FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*"
--
Kai Kang
Wind River Linux
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-22 1:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-21 16:49 [PATCH] cups: set rundir to /run/cups if systemd is used Oleksandr Kravchuk
2021-02-21 16:51 ` Oleksandr Kravchuk
2021-02-22 1:41 ` kai
2021-02-21 17:00 ` [OE-core] " Khem Raj
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.