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
This commit is contained in:
parent
dff6e4a004
commit
30cc3cdb76
@ -113,7 +113,8 @@ mount_cgroups()
|
|||||||
yesno ${rc_controller_cgroups:-YES} && [ -e /proc/cgroups ] || return 0
|
yesno ${rc_controller_cgroups:-YES} && [ -e /proc/cgroups ] || return 0
|
||||||
while read name hier groups enabled rest; do
|
while read name hier groups enabled rest; do
|
||||||
case "${enabled}" in
|
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} \
|
mount -n -t cgroup -o ${sysfs_opts},${name} \
|
||||||
${name} /sys/fs/cgroup/${name}
|
${name} /sys/fs/cgroup/${name}
|
||||||
;;
|
;;
|
||||||
@ -129,25 +130,13 @@ restorecon_sys()
|
|||||||
restorecon -rF /sys/fs/cgroup >/dev/null 2>&1
|
restorecon -rF /sys/fs/cgroup >/dev/null 2>&1
|
||||||
eend $?
|
eend $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
local retval
|
|
||||||
mount_sys
|
mount_sys
|
||||||
retval=$?
|
|
||||||
if [ $retval -eq 0 ]; then
|
|
||||||
mount_misc
|
mount_misc
|
||||||
retval=$?
|
|
||||||
fi
|
|
||||||
if [ $retval -eq 0 ]; then
|
|
||||||
mount_cgroups
|
mount_cgroups
|
||||||
retval=$?
|
|
||||||
fi
|
|
||||||
|
|
||||||
restorecon_sys
|
restorecon_sys
|
||||||
|
return 0
|
||||||
return $retval
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user