1
2CGEXEC(1) libcgroup Manual CGEXEC(1)
3
4
5
7 cgexec - run the task in given control groups
8
9
11 cgexec [-h] [-g <controllers>:<path>] [--sticky] command [arguments]
12
13
15 The cgexec program executes the task command with arguments arguments
16 in the given control groups.
17
18
19 -g <controllers>:<path>
20 defines the control groups in which the task will be run. con‐
21 trollers is a list of controllers and path is the relative path
22 to control groups in the given controllers list.
23
24 This flag can be used multiple times to define multiple pairs of
25 lists of controllers and relative paths. Instead of the list of
26 all mounted controllers, the wildcard b"*b" can be used.
27
28 If this option is not used, cgexec will automatically place the
29 task in the right cgroup based on /etc/cgrules.conf.
30
31 If /etc/cgrules.conf configuration file is used, there can be
32 used template names. Then the control group name contains a tem‐
33 plate in destination tag (see cgrules.conf [22m(5)) and if the
34 cgroup does not exist in execution time, it is created, based on
35 /etc/cgconfig.conf specification. If the specifications are not
36 present the group is created with the default kernel values.
37
38
39 -h, --help
40 Display this help and exit.
41
42
43 --sticky
44 If running the task command with this option, the daemon of ser‐
45 vice cgred (cgrulesengd process) does not change both the task
46 of the command and the child tasks. Without this option, the
47 daemon does not change the task of the command but it changes
48 the child tasks to the right cgroup based on /etc/cgrules.conf
49 automatically.
50
51
53 cgexec -g *:test1 ls
54 runs command ls in control group test1 in all mounted controllers.
55
56 cgexec -g cpu,memory:test1 ls -l
57 runs command ls -l in control group test1 in controllers cpu and mem‐
58 ory.
59
60 cgexec -g cpu,memory:test1 -g swap:test2 ls -l
61 runs command ls -l in control group test1 in controllers cpu and memory
62 and control group test2 in controller swap.
63
64
66 CGROUP_LOGLEVEL
67 controls verbosity of the tool. Allowed values are DEBUG, INFO,
68 WARNING or ERROR.
69
70
72 /etc/cgrules.conf
73 default libcgroup configuration file
74
75
77 cgrules.conf (5)
78
79
80
81Linux 2009-03-15 CGEXEC(1)