diff options
| author | Zoltan Boszormenyi <zboszor@gmail.com> | 2024-07-28 16:29:06 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-08-03 07:56:10 +0100 |
| commit | ee83d0fdae1482583f156d8b8f217c170d9de473 (patch) | |
| tree | 2e4abdb0b0f26e6222b19f515cd5f6a755031f1a /meta | |
| parent | 2dded9958328d9e5a801dd3cb2d0084f538cfef6 (diff) | |
| download | poky-ee83d0fdae1482583f156d8b8f217c170d9de473.tar.gz | |
rpcbind: Fix boot time start failure
With commits 90bc1810 ("bitbake.conf: Add runtimedir") and
561e853e ("rpcbind: Specify state directory under /run") rpcbind
still can fail during startup with:
rpcbind: /var/run/rpcbind.lock: Read-only file system
The lockfile is hardcoded as "/var/run/rpcbind.lock".
While it should use the same internal define "RPCBIND_STATEDIR"
as the paths for rpcbind.xdr and portmap.xdr, it's not necessary
to be patched because of the default value of ${runtimedir} and
the presence of the /var/run -> /run symlink.
Using --with-statedir=/run/rpcbind adds the line
RequiresMountsFor=/run/rpcbind
to the service but it doesn't guarantee that /run is writable yet
when rpcbind.service starts. Add this guarantee by running
rpcbind.service with systemd-tmpfiles-setup.service and add the
tmpfiles.d entry for /run/rpcbind.
(From OE-Core rev: 53fb871f84c99a66485979da2588c1d11d8749e7)
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-extended/rpcbind/rpcbind/rpcbind.systemd | 3 | ||||
| -rw-r--r-- | meta/recipes-extended/rpcbind/rpcbind/rpcbind.tmpfiles | 1 | ||||
| -rw-r--r-- | meta/recipes-extended/rpcbind/rpcbind_1.2.6.bb | 10 |
3 files changed, 14 insertions, 0 deletions
diff --git a/meta/recipes-extended/rpcbind/rpcbind/rpcbind.systemd b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.systemd new file mode 100644 index 0000000000..5765751326 --- /dev/null +++ b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.systemd | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | [Unit] | ||
| 2 | # Make sure the runtime directory exists | ||
| 3 | After=systemd-tmpfiles-setup.service | ||
diff --git a/meta/recipes-extended/rpcbind/rpcbind/rpcbind.tmpfiles b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.tmpfiles new file mode 100644 index 0000000000..fecee72c09 --- /dev/null +++ b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.tmpfiles | |||
| @@ -0,0 +1 @@ | |||
| d /run/rpcbind 0755 root root - | |||
diff --git a/meta/recipes-extended/rpcbind/rpcbind_1.2.6.bb b/meta/recipes-extended/rpcbind/rpcbind_1.2.6.bb index e751eb631c..aeca86e564 100644 --- a/meta/recipes-extended/rpcbind/rpcbind_1.2.6.bb +++ b/meta/recipes-extended/rpcbind/rpcbind_1.2.6.bb | |||
| @@ -13,6 +13,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b46486e4c4a416602693a711bb5bfa39 \ | |||
| 13 | SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \ | 13 | SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \ |
| 14 | file://init.d \ | 14 | file://init.d \ |
| 15 | file://rpcbind.conf \ | 15 | file://rpcbind.conf \ |
| 16 | file://rpcbind.tmpfiles \ | ||
| 17 | file://rpcbind.systemd \ | ||
| 16 | file://rpcbind_add_option_to_fix_port_number.patch \ | 18 | file://rpcbind_add_option_to_fix_port_number.patch \ |
| 17 | file://0001-systemd-use-EnvironmentFile.patch \ | 19 | file://0001-systemd-use-EnvironmentFile.patch \ |
| 18 | " | 20 | " |
| @@ -49,7 +51,15 @@ do_install:append () { | |||
| 49 | ${UNPACKDIR}/init.d > ${D}${sysconfdir}/init.d/rpcbind | 51 | ${UNPACKDIR}/init.d > ${D}${sysconfdir}/init.d/rpcbind |
| 50 | chmod 0755 ${D}${sysconfdir}/init.d/rpcbind | 52 | chmod 0755 ${D}${sysconfdir}/init.d/rpcbind |
| 51 | install -m 0644 ${UNPACKDIR}/rpcbind.conf ${D}${sysconfdir}/rpcbind.conf | 53 | install -m 0644 ${UNPACKDIR}/rpcbind.conf ${D}${sysconfdir}/rpcbind.conf |
| 54 | |||
| 55 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
| 56 | install -m 0644 ${UNPACKDIR}/rpcbind.tmpfiles ${D}${sysconfdir}/tmpfiles.d/rpcbind.conf | ||
| 57 | |||
| 58 | install -d ${D}${systemd_system_unitdir}/rpcbind.service.d | ||
| 59 | install -m 0644 ${UNPACKDIR}/rpcbind.systemd ${D}${systemd_system_unitdir}/rpcbind.service.d/rpcbind.conf | ||
| 52 | } | 60 | } |
| 53 | 61 | ||
| 62 | FILES:${PN} += "${systemd_system_unitdir}/rpcbind.service.d/rpcbind.conf" | ||
| 63 | |||
| 54 | ALTERNATIVE:${PN} = "rpcinfo" | 64 | ALTERNATIVE:${PN} = "rpcinfo" |
| 55 | ALTERNATIVE_LINK_NAME[rpcinfo] = "${bindir}/rpcinfo" | 65 | ALTERNATIVE_LINK_NAME[rpcinfo] = "${bindir}/rpcinfo" |
