From 3258edc24628db82ef227d86cec4c60a4bd6849f Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sat, 23 Dec 2017 19:02:06 +0100 Subject: [PATCH] Fix #90: Restore tmpfs mount of /dev/shm, removed in d7401b2 Signed-off-by: Joachim Nilsson --- src/finit.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/finit.c b/src/finit.c index 90d37c4b..67709761 100644 --- a/src/finit.c +++ b/src/finit.c @@ -400,8 +400,15 @@ int main(int argc, char* argv[]) makedir("/dev/pts", 0755); mount("devpts", "/dev/pts", "devpts", 0, "gid=5,mode=620"); - /* Some systems rely on /dev/shm being there, for `mount -a` below */ + /* + * Some systems rely on us to both create /dev/shm and, to mount + * a tmpfs there. Any system with dbus needs shared memory, so + * mount it, unless its already mounted, but not if listed in + * the /etc/fstab file already. + */ makedir("/dev/shm", 0755); + if (!fismnt("/dev/shm") && !ismnt("/etc/fstab", "/dev/shm")) + mount("shm", "/dev/shm", "tmpfs", 0, NULL); /* * New tmpfs based /run for volatile runtime data