From 8db6668c8d78d4d2072445c50596d4d8d981235b Mon Sep 17 00:00:00 2001 From: Weng Meiling Date: Tue, 10 Sep 2013 08:06:20 +0200 Subject: [PATCH] cgred:cgred should start when cgroup is mounted If we mount the cgroup without the name cgroup like the following: cpu on /cgroup/cpu type cgroup (rw,cpu) the cgred service will start failed, because it just check the name. So changing cgred to check the mounted system's type instead of the name. v1 -> v2 Using the right method to check cgroup filesystem. The first version patch's method is wrong, so resend the second patch. Signed-off-by: Weng Meiling Acked-by: Ivana Hutarova Varekova --- scripts/init.d/cgred.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/init.d/cgred.in b/scripts/init.d/cgred.in index ed757cfa..247ec610 100644 --- a/scripts/init.d/cgred.in +++ b/scripts/init.d/cgred.in @@ -73,7 +73,8 @@ start() log_failure_msg "$servicename is already running with PID `cat ${pidfile}`" return 0 fi - if ! grep "^cgroup" /proc/mounts &>/dev/null; then + num=`grep "cgroup" /proc/mounts | awk '$3=="cgroup"' | wc -l` + if [ $num -eq 0 ]; then echo log_failure_msg $"Cannot find cgroups, is cgconfig service running?" return 1 -- 2.47.2