]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
systemd: Fix unwritable /var/lock when no sysvinit handling
authorniko.mauno@vaisala.com <niko.mauno@vaisala.com>
Mon, 5 Sep 2022 12:26:11 +0000 (12:26 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 Sep 2022 13:55:51 +0000 (14:55 +0100)
Commit 8089cefed8e83c0348037768c292058f1bcbbbe5 ("systemd: Add
PACKAGECONFIG for sysvinit") decoupled enabling of systemd's sysvinit
handling behavior behind a distinct PACKAGECONFIG feature.

This new option affects among other things the installing of
tmpfiles.d/legacy.conf, which is responsible for creating /run/lock
directory, which is pointed to by /var/lock symlink provided by
base-files package.

In case the option is not enabled, then base-files provided /var/lock
is a dangling symlink on resulting rootfs, causing problems with
certain Linux userspace components that rely on existence of writable
/var/lock directory. As an example:

  # fw_printenv
  Error opening lock file /var/lock/fw_printenv.lock

Since Filesystem Hierarchy Standard Version 3.0 states in
https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s09.html that

  Lock files should be stored within the /var/lock directory structure.

Ensure the /run/lock directory is always created, so that lock files
can be stored under /var/lock also when 'sysvinit' handling is
disabled.

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/systemd/systemd/00-create-volatile.conf

index 87cbe1e7d3c3f156a8505fc77af73dbb93a981a1..c4277221a22edeb8506909e4732278c3e891689f 100644 (file)
@@ -3,5 +3,6 @@
 # inside /var/log.
 
 
+d              /run/lock               1777    -       -       -
 d              /var/volatile/log               -       -       -       -
 d              /var/volatile/tmp               1777    -       -