From 5f890ee8ab94f8760f4840d280feb7eced999068 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Mon, 22 Mar 2021 15:47:21 -0500 Subject: [PATCH] init.sh: rework the /run setup for linux xystems - fix mount options for /run. - run restorecon after everything is set up. X-Gentoo-Bug: 740576 X-Gentoo-Bug-URL: https://bugs.gentoo.org/740576 --- sh/init.sh.Linux.in | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sh/init.sh.Linux.in b/sh/init.sh.Linux.in index 222bbd3b..e8afc1fb 100644 --- a/sh/init.sh.Linux.in +++ b/sh/init.sh.Linux.in @@ -71,20 +71,17 @@ if [ "$sys" = VSERVER ]; then rm -rf /run/* elif ! mountinfo -q /run; then ebegin "Mounting /run" - rc=0 + run_mount_opts="mode=0755,nosuid,nodev,nr_inodes=800k,size=20%,strictatime" if ! fstabinfo --mount /run; then - mount -t tmpfs -o mode=0755,nodev,size=10% tmpfs /run - rc=$? - fi - if [ $rc != 0 ]; then - eerror "Unable to mount tmpfs on /run." - eerror "Can't continue." - exit 1 + if ! mount -t tmpfs -o ${run_mount_opts} tmpfs /run; then + eerror "Unable to mount tmpfs on /run." + eerror "Can't continue." + exit 1 + fi fi fi -[ -x /sbin/restorecon ] && /sbin/restorecon -rF /run -checkpath -d $RC_SVCDIR +checkpath -d "$RC_SVCDIR" checkpath -d -m 0775 -o root:uucp /run/lock # Try to mount xenfs as early as possible, otherwise rc_sys() will always @@ -102,4 +99,5 @@ if [ -e "$RC_LIBEXECDIR"/cache/softlevel ]; then fi echo sysinit >"$RC_SVCDIR"/softlevel +[ -x /sbin/restorecon ] && /sbin/restorecon -rF /run exit 0