Hi,
A new flag CGROUP_DAEMON_CANCEL_UNCHANGE_PROCESS cancels the unchanged process.
If specifying this flag as the argument of cgroup_register_unchanged_process,
a cgrulesengd daemon can move the specified process to right cgroup based on
/etc/cgrules.conf.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
* The daemon must not touch the given task, i.e. it never moves it
* to any controlgroup.
*/
- CGROUP_DAEMON_UNCHANGE_CHILDREN = 0x1,
+ CGROUP_DAEMON_UNCHANGE_CHILDREN = 0x1,
+ CGROUP_DAEMON_CANCEL_UNCHANGE_PROCESS = 0x2,
};
/**
cgroup_dbg("read error: %s\n", strerror(errno));
goto close;
}
- if (cgre_store_unchanged_process(pid, flags))
- goto close;
-
+ if (flags == CGROUP_DAEMON_CANCEL_UNCHANGE_PROCESS) {
+ cgre_remove_unchanged_process(pid);
+ } else {
+ if (cgre_store_unchanged_process(pid, flags))
+ goto close;
+ }
if (write(fd_client, CGRULE_SUCCESS_STORE_PID,
sizeof(CGRULE_SUCCESS_STORE_PID)) < 0) {
cgroup_dbg("write error: %s\n", strerror(errno));