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.weng@huawei.com>
Acked-by: Ivana Hutarova Varekova <varekova@redhat.com>
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