From: Weng Meiling <wengmeiling.w...@huawei.com>

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 <wengmeiling.w...@huawei.com>
---
 scripts/init.d/cgred.in |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/scripts/init.d/cgred.in b/scripts/init.d/cgred.in
index ed757cf..247ec61 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
-- 
1.7.1



------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to