diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2021-03-22 15:47:21 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2021-03-22 15:47:21 -0500 |
commit | 5f890ee8ab94f8760f4840d280feb7eced999068 (patch) | |
tree | 79af39d3496910172eb596e9de916f3c0d682da9 /sh | |
parent | ef76a663bcc03d4cc9dd1ef05c800f208e26d0ed (diff) |
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
Diffstat (limited to 'sh')
-rw-r--r-- | sh/init.sh.Linux.in | 18 |
1 files 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 |