How can I check if cgroups are available on my Linux host?
UPDATE: Upon re-reading your question, I realized that I had answered a slightly different one. You want to know whether a service is running, and I had originally answered how to tell if a package was installed. To answer your actual question, it depends upon your init system.
systemd - the basic command is
systemctl
, which will list all services and their states, so you could either manually browse it manually or pipe it through agrep
command, like so:systemctl | grep -e cgmanager -e cgproxy -e cgroupfs-mount
. Or, as user muru suggests in the comments, simplysystemctl status 'cg*'
.sysVinit - the basic command is
service --status-all
and the grep command would beservice --status-all 2>&1 | grep -e cgmanager -e cgproxy -e cgroupfs-mount
. Note that in this case, running services are denoted with a[+]
prefix symbol. Also note that for the grep to work, the redirect2>&1
must be made for theservice
command.
ORIGINAL ANSWER:
Maybe the simplest thing to do is try
man cgroups
. If that brings up a documentation page, then your host has the package installed. However, some installs are 'stingy' and don't installman
pages.You could try
cgm
and see if that produces output. Most installs ofcgroups
will include that command, but not necessarily.You could look up the package list of your host distribution. On debian derivatives, that would be
dpkg -l |grep cgroup
, but occasionally a system will restrict access toroot
orsudo
fordpkg
.
There will be a lot of other ways.