Skip to contentSkip to conversation

quagga: fix tmpfiles snippet to refer to /run instead of /var/run

PATCH In review Dan Callaghan 2 participants 5 messages Feb 11, 2020 – Feb 19, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 quagga: fix tmpfiles snippet to refer to /run instead of /var/run

This fixes a complaint from systemd on boot:

systemd-tmpfiles[393]: [/etc/tmpfiles.d/quagga.conf:1] Line references path below legacy directory /var/run/, updating /var/run/quagga → /run/quagga; please update the tmpfiles.d/ drop-in file accordingly.

---
 meta-networking/recipes-protocols/quagga/quagga.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-networking/recipes-protocols/quagga/quagga.inc +1 -1
index dfd6aa7eb..2673a8976 100644
@@ -117,7 +117,7 @@ do_install () {
 
     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
         install -d ${D}${sysconfdir}/tmpfiles.d
-        echo "d /var/run/quagga 0755 quagga quagga -" \
+        echo "d /run/quagga 0755 quagga quagga -" \
         > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
     fi
 
Signature · 1 line
2.21.1
#1 lore raw

PATCH 2/2 quagga: install tmpfiles snippet to /usr/lib/tmpfiles.d

Package-owned tmpfiles snippets belong in /usr/lib/tmpfiles.d, /etc/tmpfiles.d is for administrator customisations.

---
 meta-networking/recipes-protocols/quagga/quagga.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-networking/recipes-protocols/quagga/quagga.inc +2 -2
index 2673a8976..f35b27160 100644
@@ -116,9 +116,9 @@ do_install () {
     done
 
     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-        install -d ${D}${sysconfdir}/tmpfiles.d
+        install -d ${D}${nonarch_libdir}/tmpfiles.d
         echo "d /run/quagga 0755 quagga quagga -" \
-        > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+        > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf
     fi
 
     # Remove sysinit script if sysvinit is not in DISTRO_FEATURES
Signature · 1 line
2.21.1
#2 lore raw

Re: [meta-networking][PATCH 2/2] quagga: install tmpfiles snippet to /usr/lib/tmpfiles.d

Quoted 15 lines · Dan Callaghan

Package-owned tmpfiles snippets belong in /usr/lib/tmpfiles.d, /etc/tmpfiles.d is for administrator customisations.

---
  meta-networking/recipes-protocols/quagga/quagga.inc | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
meta-networking/recipes-protocols/quagga/quagga.inc +0 -0
index 2673a8976..f35b27160 100644
@@ -116,9 +116,9 @@ do_install () {
      done

meta-networking/recipes-protocols/quagga/quagga.inc do_install () { · line 124

Quoted 10 lines
meta-networking/recipes-protocols/quagga/quagga.inc +2 -2
 
      if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-        install -d ${D}${sysconfdir}/tmpfiles.d
+        install -d ${D}${nonarch_libdir}/tmpfiles.d
          echo "d /run/quagga 0755 quagga quagga -" \
-        > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+        > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf
      fi
 
      # Remove sysinit script if sysvinit is not in DISTRO_FEATURES

Fails packaging

ERROR: QA Issue: quagga: Files/directories were installed but not shipped in any package:
/usr/lib/tmpfiles.d
/usr/lib/tmpfiles.d/quagga.conf

http://errors.yoctoproject.org/Errors/Details/390597/

#3 lore raw

Re: [meta-networking][PATCH 2/2] quagga: install tmpfiles snippet to /usr/lib/tmpfiles.d

Excerpts from Khem Raj's message of 2020-02-11 16:44:45 -08:00:

Quoted 29 lines · Dan Callaghan
Quoted 15 lines

Package-owned tmpfiles snippets belong in /usr/lib/tmpfiles.d, /etc/tmpfiles.d is for administrator customisations.

---
  meta-networking/recipes-protocols/quagga/quagga.inc | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
meta-networking/recipes-protocols/quagga/quagga.inc +0 -0
index 2673a8976..f35b27160 100644
@@ -116,9 +116,9 @@ do_install () {
      done

meta-networking/recipes-protocols/quagga/quagga.inc do_install () { · line 124

Quoted 10 lines
meta-networking/recipes-protocols/quagga/quagga.inc +2 -2
 
      if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-        install -d ${D}${sysconfdir}/tmpfiles.d
+        install -d ${D}${nonarch_libdir}/tmpfiles.d
          echo "d /run/quagga 0755 quagga quagga -" \
-        > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+        > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf
      fi
 
      # Remove sysinit script if sysvinit is not in DISTRO_FEATURES

Fails packaging

Quoted 7 lines

ERROR: QA Issue: quagga: Files/directories were installed but not shipped in any package:
/usr/lib/tmpfiles.d
/usr/lib/tmpfiles.d/quagga.conf

http://errors.yoctoproject.org/Errors/Details/390597/

Oops. I will send an updated patch.

I wonder if OE-Core should have a directory variable similar to ${systemd_system_unitdir}, say ${systemd_tmpfilesdir}, and put it in the global FILES list? Right now the recipes in meta-oe use a mixture of ${sysconfdir}/tmpfiles.d and ${libdir}/tmpfiles.d...

On second thought I am not quite sure if it should be ${nonarch_libdir} or ${libdir}. I can't see anywhere that the systemd recipe explicitly configures that directory at build time, but in our product systemd-tmpfiles winds up looking in /usr/lib/tmpfiles.d which I assumed was ${nonarch_libdir}/tmpfiles.d.

Signature · 3 lines
Dan Callaghan <[email protected]>
Software Engineer
Opengear <https://opengear.com/>
#4 lore raw

PATCH v2 1/1 quagga: install tmpfiles snippet to /usr/lib/tmpfiles.d

In reply to Dan Callaghan

Package-owned tmpfiles snippets belong in /usr/lib/tmpfiles.d, /etc/tmpfiles.d is for administrator customisations.

---
 meta-networking/recipes-protocols/quagga/quagga.inc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta-networking/recipes-protocols/quagga/quagga.inc +4 -2
index 2673a8976..310bc7eef 100644
@@ -116,9 +116,9 @@ do_install () {
     done
 
     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-        install -d ${D}${sysconfdir}/tmpfiles.d
+        install -d ${D}${nonarch_libdir}/tmpfiles.d
         echo "d /run/quagga 0755 quagga quagga -" \
-        > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+        > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf
     fi
 
     # Remove sysinit script if sysvinit is not in DISTRO_FEATURES
@@ -166,6 +166,8 @@ FILES_${PN}-ospfclient  = "${sbindir}/ospfclient ${libdir}/libospfapiclient.so.*
 FILES_${PN}-watchquagga = "${sbindir}/watchquagga ${sysconfdir}/default/watchquagga \
                            ${sysconfdir}/init.d/watchquagga"
 
+FILES_${PN} += "${nonarch_libdir}/tmpfiles.d/*.conf"
+
 # Indicate that the default files are configuration files
 CONFFILES_${PN} = "${sysconfdir}/default/quagga \
                    ${sysconfdir}/quagga/bgpd.conf \
Signature · 1 line
2.21.1