The cgmanager (Control Group Manager) daemon is a legacy service used in older Ubuntu releases to provide a central D-Bus API for managing Linux cgroups (control groups) from unprivileged users or containers. In modern Ubuntu deployments (16.04 LTS and later), systemd inherently manages cgroups via its native slice and scope architecture. Therefore, unless you are running very specific legacy LXC container configurations that explicitly require cgmanager as a middleman for cgroup namespace isolation, this daemon is completely redundant. It consumes memory and sits idle on modern systems where systemd has already superseded its functionality.
This guide explains how to completely disable the cgmanager daemon in Ubuntu Server, freeing up resources and removing legacy components from your modern deployment.
Stop and Mask the cgmanager Daemon
To ensure systemd completely ignores this legacy daemon and prevents any lingering dependencies from accidentally launching it, we must aggressively disable and mask the service.
- Log into your Ubuntu Server via SSH using an account with
sudoprivileges. - First, check if the service is currently running and force it to stop immediately:
sudo systemctl stop cgmanager.service - Next, disable the service to prevent it from automatically launching during the boot sequence:
sudo systemctl disable cgmanager.service - Finally, to guarantee that the daemon cannot be invoked by D-Bus activation or rogue scripts, mask it entirely:
sudo systemctl mask cgmanager.service
Verify the Service Lockdown
By masking the service, you have instructed systemd to symlink the unit file to /dev/null, effectively treating it as a black hole. The systemd manager will immediately reject any attempt to start it.
To verify the lockdown is successful, run the following command to check the status of the service:
systemctl status cgmanager.service
The output will clearly state that the service is masked. You can also verify that the D-Bus socket usually associated with it (/sys/fs/cgroup/cgmanager/sock) is no longer active. You have successfully streamlined your server by removing an obsolete cgroup manager.