summaryrefslogtreecommitdiff
path: root/sh/init.sh.Linux.in
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2012-07-02 13:22:04 -0500
committerWilliam Hubbs <williamh@gentoo.org>2012-07-02 13:22:04 -0500
commita5b4fab7321c4feac2bc981b7fbf4b32bb5bb981 (patch)
treeb91557fba902d7f3fc39cf990b538aac3d48034c /sh/init.sh.Linux.in
parentde36b26d5e8e331d91a3f2db04174d7d203210a1 (diff)
downloadopenrc-a5b4fab7321c4feac2bc981b7fbf4b32bb5bb981.tar.gz
openrc-a5b4fab7321c4feac2bc981b7fbf4b32bb5bb981.tar.bz2
openrc-a5b4fab7321c4feac2bc981b7fbf4b32bb5bb981.tar.xz
fix handling of /run for vserver
Mount can't be used in vservers, but /run is still needed. So we create the directory and clear it out instead of mounting a tmpfs in that situation. reported-by: <patrick@gentoo.org> X-Gentoo-Bug: 423739 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=423739
Diffstat (limited to 'sh/init.sh.Linux.in')
-rw-r--r--sh/init.sh.Linux.in19
1 files changed, 14 insertions, 5 deletions
diff --git a/sh/init.sh.Linux.in b/sh/init.sh.Linux.in
index 5daa1bb..0eca736 100644
--- a/sh/init.sh.Linux.in
+++ b/sh/init.sh.Linux.in
@@ -37,14 +37,23 @@ fi
# /run is a new directory for storing volatile runtime data.
# Read more about /run at https://lwn.net/Articles/436012
+sys="$(rc --sys)"
+
if [ ! -d /run ]; then
- eerror "The /run directory does not exist. Unable to continue."
- return 1
+ if [ "$sys" = VSERVER ]; then
+ if [ -e /run ]; then
+ rm -rf /run
+ fi
+ mkdir /run
+ else
+ eerror "The /run directory does not exist. Unable to continue."
+ return 1
+ fi
fi
-if mountinfo -q /run; then
- einfo "/run is already mounted, skipping"
-else
+if [ "$sys" = VSERVER ]; then
+ rm -rf /run/*
+elif ! mountinfo -q /run; then
ebegin "Mounting /run"
rc=0
if ! fstabinfo --mount /run; then