cgsnapshot - generate the configuration file for given controllers
| Use Case | Command | Description |
|---|---|---|
| Generate config for all mounted controllers | cgsnapshot -s -f /etc/cgconfig.conf.cgsnapshot | Create a configuration file containing all mounted controllers and control groups |
| Generate config for a specific controller | cgsnapshot -s -f /etc/cgconfig.conf.cgsnapshot cpu | Create a configuration file for the cpu controller hierarchy |
| Use custom blacklist file | cgsnapshot -b /path/to/blacklist.conf | Only display variables from the blacklist |
| Use custom whitelist file | cgsnapshot -w /path/to/whitelist.conf | Only display variables on the whitelist (with warnings for others) |
| Silent mode (no warnings) | cgsnapshot -s | Ignore all warnings |
| Strict mode (hide non-whitelisted) | cgsnapshot -t | Do not display variables not on the whitelist |
| Display help | cgsnapshot -h | Show help and exit |
cgsnapshot [-h] [-s] [-t] [-b file] [-w file] [-f output_file] [controller] [...]
cgsnapshot generates the cgconfig compatible configuration file for the given controllers. If no controller is set, then cgsnapshot shows all mounted hierarchies. The output is in the same format as the cgconfig.conf configuration file.
Display only variables from the blacklist. The default location of the blacklist is /etc/cgsnapshot_blacklist.conf. This list contains all variables which should be ignored by cgsnapshot. If the variable is blacklisted, it will not be displayed. If it is not present on the blacklist, the whitelist is checked.
Display this help and exit.
Redirect the output to output_file.
Ignore all warnings.
Do not display the variables which are not on the whitelist.
Set the blacklist configuration file. This list contains all variables which should be displayed by cgsnapshot. If the variable is not blacklisted, the whitelist is checked. If the variable is on the whitelist, it is displayed by cgsnapshot. If the variable is not on the whitelist, the variable is displayed and a warning message is produced. By default the whitelist is not used.
The warning message can be omitted using the -s, --silent flag. If the -t, --strict flag is used, the variable which is not on the whitelist is not displayed.
Defines the controller whose hierarchies will be output.
Controls verbosity of the tool. Allowed values are DEBUG, INFO, WARNING or ERROR.
cgsnapshot -s -f /etc/cgconfig.conf.cgsnapshot
Create configuration file which contains all mounted controllers and all control groups which are on the actual system.
cgsnapshot -s -f /etc/cgconfig.conf.cgsnapshot cpu
Create configuration file which contains hierarchy containing cpu controller and all its control groups on the actual system.
cgconfig.conf (5)
Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-03 10:01 @216.73.216.239
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)