Patchwork base-files: add /run to dirs755 for systemd

login
register
mail settings
Submitter Jonathan Liu
Date May 13, 2013, 3:58 a.m.
Message ID <1368417521-9219-1-git-send-email-net147@gmail.com>
Download mbox | patch
Permalink /patch/49805/
State Superseded, archived
Headers show

Comments

Jonathan Liu - May 13, 2013, 3:58 a.m.
The /run directory needs to exist when using systemd otherwise startup
fails with the following error:
systemd[1]: Failed to mount /run: No such file or directory

This affects directdisk and vmdk images but images using an initrd do
not appear to be affected.

Signed-off-by: Jonathan Liu <net147@gmail.com>
---
 meta/recipes-core/base-files/base-files_3.0.14.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Ross Burton - May 13, 2013, 10:53 a.m.
On 13 May 2013 04:58, Jonathan Liu <net147@gmail.com> wrote:
> The /run directory needs to exist when using systemd otherwise startup
> fails with the following error:
> systemd[1]: Failed to mount /run: No such file or directory

This is a genuine bug, but I'm not convinced it is the whole fix.
What about non-systemd images?  /run is meant to be a tmpfs, which is
why udev installs a volatile link from /run to /var/run.  If we create
a directory in sysvinit cases, we'll also need to mount a tmpfs on it.

The FHS 3 draft specification actually ratifies /run[1] so we could
take this advantage to start cleaning up our volatile layout in /var.
Start by always creating /run in base-files, and always mounting it as
tmpfs in fstab for the non-systemd case.  Then we can symlink /var/run
to /run, /var/lock to /run/lock, and so on.

Ross

[1] http://www.linuxbase.org/betaspecs/fhs/fhs.html#runRuntimeVariableData
Jonathan Liu - May 19, 2013, 1:25 p.m.
On 13/05/2013 8:53 PM, Burton, Ross wrote:
> On 13 May 2013 04:58, Jonathan Liu <net147@gmail.com> wrote:
>> The /run directory needs to exist when using systemd otherwise startup
>> fails with the following error:
>> systemd[1]: Failed to mount /run: No such file or directory
> This is a genuine bug, but I'm not convinced it is the whole fix.
> What about non-systemd images?  /run is meant to be a tmpfs, which is
> why udev installs a volatile link from /run to /var/run.  If we create
> a directory in sysvinit cases, we'll also need to mount a tmpfs on it.
>
> The FHS 3 draft specification actually ratifies /run[1] so we could
> take this advantage to start cleaning up our volatile layout in /var.
> Start by always creating /run in base-files, and always mounting it as
> tmpfs in fstab for the non-systemd case.  Then we can symlink /var/run
> to /run, /var/lock to /run/lock, and so on.
I have submitted a more complete patch for your review.
> Ross
>
> [1] http://www.linuxbase.org/betaspecs/fhs/fhs.html#runRuntimeVariableData
Regards,
Jonathan

Patch

diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index a56450d..7713564 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -34,7 +34,7 @@  docdir_append = "/${P}"
 dirs1777 = "/tmp ${localstatedir}/volatile/lock ${localstatedir}/volatile/tmp"
 dirs2775 = "/home ${prefix}/src ${localstatedir}/local"
 dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
-           ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /sbin \
+           ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \
            ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
            ${libdir} ${sbindir} ${datadir} \
            ${datadir}/common-licenses ${datadir}/dict ${infodir} \