public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/
Date: Mon, 24 Nov 2014 04:03:35 +0000 (UTC)	[thread overview]
Message-ID: <1416801541.2eb0ea9afbba584fc4c5ee0feefa9ae6a3d3278d.williamh@OpenRC> (raw)

commit:     2eb0ea9afbba584fc4c5ee0feefa9ae6a3d3278d
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Sun Nov 23 16:28:21 2014 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Nov 24 03:59:01 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=2eb0ea9a

Make sysfs behave like netmount and localmount

sysfs now mounts all related sysfs file systems and returns success,
like netmount and localmount.

Also, we now check to make sure the cgroups are not mounted before we
mount them.

X-Gentoo-Bug: 530138
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=530138

---
 init.d/sysfs.in | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/init.d/sysfs.in b/init.d/sysfs.in
index 67485c2..bc0d9d3 100644
--- a/init.d/sysfs.in
+++ b/init.d/sysfs.in
@@ -113,7 +113,8 @@ mount_cgroups()
 	yesno ${rc_controller_cgroups:-YES} && [ -e /proc/cgroups ] || return 0
 	while read name hier groups enabled rest; do
 		case "${enabled}" in
-			1)	mkdir /sys/fs/cgroup/${name}
+			1)	mountinfo -q /sys/fs/cgroup/${name} && continue
+				mkdir /sys/fs/cgroup/${name}
 				mount -n -t cgroup -o ${sysfs_opts},${name} \
 					${name} /sys/fs/cgroup/${name}
 				;;
@@ -129,25 +130,13 @@ restorecon_sys()
 		restorecon -rF /sys/fs/cgroup >/dev/null 2>&1
 		eend $?
 	fi
-
-	return 0
 }
 
 start()
 {
-	local retval
 	mount_sys
-	retval=$?
-	if [ $retval -eq 0 ]; then
-		mount_misc
-		retval=$?
-	fi
-	if [ $retval -eq 0 ]; then
-		mount_cgroups
-		retval=$?
-	fi
-
+	mount_misc
+	mount_cgroups
 	restorecon_sys
-
-	return $retval
+	return 0
 }


             reply	other threads:[~2014-11-24  4:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-24  4:03 William Hubbs [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-02-27  2:33 [gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/ Robin H. Johnson
2015-02-18 18:59 William Hubbs
2015-02-05  4:12 William Hubbs
2015-01-18 15:43 William Hubbs
2014-11-20 17:08 William Hubbs
2014-11-07 17:34 William Hubbs
2014-10-20 21:05 William Hubbs
2014-10-16 17:41 William Hubbs
2014-10-16 17:41 William Hubbs
2014-08-22 19:21 William Hubbs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416801541.2eb0ea9afbba584fc4c5ee0feefa9ae6a3d3278d.williamh@OpenRC \
    --to=williamh@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox