From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.77)
	(envelope-from <gentoo-commits+bounces-482192-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1SllLE-0006yW-Ja
	for garchives@archives.gentoo.org; Mon, 02 Jul 2012 18:27:20 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 33BB7E05D5;
	Mon,  2 Jul 2012 18:27:03 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 0545EE05D5
	for <gentoo-commits@lists.gentoo.org>; Mon,  2 Jul 2012 18:27:02 +0000 (UTC)
Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 6A6591B40C2
	for <gentoo-commits@lists.gentoo.org>; Mon,  2 Jul 2012 18:27:02 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by hornbill.gentoo.org (Postfix) with ESMTP id D00D4E5436
	for <gentoo-commits@lists.gentoo.org>; Mon,  2 Jul 2012 18:27:00 +0000 (UTC)
From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" <williamh@gentoo.org>
Message-ID: <1341253324.a5b4fab7321c4feac2bc981b7fbf4b32bb5bb981.WilliamH@OpenRC>
Subject: [gentoo-commits] proj/openrc:master commit in: sh/
X-VCS-Repository: proj/openrc
X-VCS-Files: sh/init.sh.Linux.in
X-VCS-Directories: sh/
X-VCS-Committer: WilliamH
X-VCS-Committer-Name: William Hubbs
X-VCS-Revision: a5b4fab7321c4feac2bc981b7fbf4b32bb5bb981
X-VCS-Branch: master
Date: Mon,  2 Jul 2012 18:27:00 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 89532fc8-eee5-4164-8e06-3e0cbbea14d6
X-Archives-Hash: 5e36b12e313fdc2d0e1935a89cc48098

commit:     a5b4fab7321c4feac2bc981b7fbf4b32bb5bb981
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Mon Jul  2 18:22:04 2012 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Jul  2 18:22:04 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D=
commit;h=3Da5b4fab7

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 <AT> gentoo.org>
X-Gentoo-Bug: 423739
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=3D423739

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