]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
'service cgred start' should print some meaningful error message when
authorJan Safranek <jsafrane@redhat.com>
Wed, 10 Nov 2010 15:09:55 +0000 (16:09 +0100)
committerJan Safranek <jsafrane@redhat.com>
Wed, 10 Nov 2010 15:09:55 +0000 (16:09 +0100)
there are no cgroups on the system.

Before:
Starting CGroup Rules Engine Daemon:              [FAILED]
After:
Starting CGroup Rules Engine Daemon:
Cannot find cgroups, is cgconfig service running? [FAILED]

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
scripts/init.d/cgred.in

index 4cea5a472c25ceee1c9f59adbf78e2ba7443fb47..ba89aee29f3af9e8ab07abb51a326e3cbecaf513 100644 (file)
@@ -72,6 +72,11 @@ start()
                log_failure_msg "not configured"
                return 6
        fi
+       if ! grep "^cgroup" /proc/mounts &>/dev/null; then
+               echo
+               log_failure_msg $"Cannot find cgroups, is cgconfig service running?"
+               return 1
+       fi
        daemon --check $servicename --pidfile $pidfile $CGRED_BIN $OPTIONS
        RETVAL=$?
        echo