aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2014-11-23 10:28:21 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2014-11-23 21:39:20 -0600
commit30cc3cdb76a66c7c0f89a52db4e5cff77b570e31 (patch)
treefcd97633d1609acb1d59099f51d4237f3dbaa1ca
parentdff6e4a004afeaa64f4ccb07c7d31bb821b043b4 (diff)
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
-rw-r--r--init.d/sysfs.in21
1 files changed, 5 insertions, 16 deletions
diff --git a/init.d/sysfs.in b/init.d/sysfs.in
index 67485c24..bc0d9d3d 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
}