cgclassify \- move running task(s) to given cgroups
.SH SYNOPSIS
-\fBcgclassify\fR [\fB-g\fR <\fIcontrollers>:<path\fR>] [--sticky] <\fIpidlist\fR>
+\fBcgclassify\fR [\fB-g\fR <\fIcontrollers>:<path\fR>] [--sticky | --cancel-sticky] <\fIpidlist\fR>
.SH DESCRIPTION
this command moves processes defined by the list
specified \fBpidlist\fR but it changes their children tasks to the
right cgroup based on \fB/etc/cgrules.conf\fR automatically.
+.TP
+.B --cancel-sticky
+If this option is used, the daemon of service cgred (cgrulesengd
+process) can change both the specified \fBpidlist\fR and their
+children tasks to right cgroup based on \fB/etc/cgrules.conf\fR
+automatically.
+
.SH FILES
.LP
.PD .1v
static struct option longopts[] = {
{"sticky", no_argument, NULL, 's'},
+ {"cancel-sticky", no_argument, NULL, 'u'},
{0, 0, 0, 0}
};
int ret = 0, i, exit_code = 0;
pid_t pid;
int cg_specified = 0;
- int flag_child = 0;
+ int flag = 0;
struct cgroup_group_spec *cgroup_list[CG_HIER_MAX];
int c;
if (argc < 2) {
fprintf(stderr, "usage is %s "
"[-g <list of controllers>:<relative path to cgroup>] "
- "[--sticky] <list of pids> \n",
+ "[--sticky | --cancel-sticky] <list of pids> \n",
argv[0]);
exit(2);
}
cg_specified = 1;
break;
case 's':
- flag_child |= CGROUP_DAEMON_UNCHANGE_CHILDREN;
+ flag |= CGROUP_DAEMON_UNCHANGE_CHILDREN;
+ break;
+ case 'u':
+ flag |= CGROUP_DAEMON_CANCEL_UNCHANGE_PROCESS;
break;
default:
fprintf(stderr, "Invalid command line option\n");
for (i = optind; i < argc; i++) {
pid = (uid_t) atoi(argv[i]);
- if (flag_child)
- ret = cgroup_register_unchanged_process(pid, flag_child);
+ if (flag)
+ ret = cgroup_register_unchanged_process(pid, flag);
if (ret)
exit_code = 1;