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
This commit is contained in:
William Hubbs 2012-07-02 13:22:04 -05:00
parent de36b26d5e
commit a5b4fab732

View File

@ -37,14 +37,23 @@ fi
# /run is a new directory for storing volatile runtime data. # /run is a new directory for storing volatile runtime data.
# Read more about /run at https://lwn.net/Articles/436012 # Read more about /run at https://lwn.net/Articles/436012
sys="$(rc --sys)"
if [ ! -d /run ]; then if [ ! -d /run ]; then
eerror "The /run directory does not exist. Unable to continue." if [ "$sys" = VSERVER ]; then
return 1 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 fi
if mountinfo -q /run; then if [ "$sys" = VSERVER ]; then
einfo "/run is already mounted, skipping" rm -rf /run/*
else elif ! mountinfo -q /run; then
ebegin "Mounting /run" ebegin "Mounting /run"
rc=0 rc=0
if ! fstabinfo --mount /run; then if ! fstabinfo --mount /run; then