Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:openrc-0.10.x commit in: sh/
Date: Mon, 02 Jul 2012 18:48:31
Message-Id: 1341254878.d5ecc9d7468403487361c7515133b1e1cb7c0ebf.WilliamH@OpenRC
1 commit: d5ecc9d7468403487361c7515133b1e1cb7c0ebf
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jul 2 18:22:04 2012 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 2 18:47:58 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=d5ecc9d7
7
8 fix handling of /run for vserver
9
10 Mount can't be used in vservers, but /run is still needed. So we create
11 the directory and clear it out instead of mounting a tmpfs in that
12 situation.
13
14 reported-by: <patrick <AT> gentoo.org>
15 X-Gentoo-Bug: 423739
16 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=423739
17
18 ---
19 sh/init.sh.Linux.in | 19 ++++++++++++++-----
20 1 files changed, 14 insertions(+), 5 deletions(-)
21
22 diff --git a/sh/init.sh.Linux.in b/sh/init.sh.Linux.in
23 index 5daa1bb..0eca736 100644
24 --- a/sh/init.sh.Linux.in
25 +++ b/sh/init.sh.Linux.in
26 @@ -37,14 +37,23 @@ fi
27
28 # /run is a new directory for storing volatile runtime data.
29 # Read more about /run at https://lwn.net/Articles/436012
30 +sys="$(rc --sys)"
31 +
32 if [ ! -d /run ]; then
33 - eerror "The /run directory does not exist. Unable to continue."
34 - return 1
35 + if [ "$sys" = VSERVER ]; then
36 + if [ -e /run ]; then
37 + rm -rf /run
38 + fi
39 + mkdir /run
40 + else
41 + eerror "The /run directory does not exist. Unable to continue."
42 + return 1
43 + fi
44 fi
45
46 -if mountinfo -q /run; then
47 - einfo "/run is already mounted, skipping"
48 -else
49 +if [ "$sys" = VSERVER ]; then
50 + rm -rf /run/*
51 +elif ! mountinfo -q /run; then
52 ebegin "Mounting /run"
53 rc=0
54 if ! fstabinfo --mount /run; then