nerdexam
LPI

305-300 · Question #11

Which file in a cgroup directory contains the list of processes belonging to this cgroup?

The correct answer is C. procs. The file procs in a cgroup directory contains the list of processes belonging to this cgroup. Each line in the file shows the PID of a process that is a member of the cgroup. A process can be moved to a cgroup by writing its PID into the cgroup's procs file. For example, to…

303.4 Operations Security

Question

Which file in a cgroup directory contains the list of processes belonging to this cgroup?

Options

  • Apids
  • Bmembers
  • Cprocs
  • Dcasks
  • Esubjects

How the community answered

(41 responses)
  • A
    2% (1)
  • B
    12% (5)
  • C
    76% (31)
  • D
    7% (3)
  • E
    2% (1)

Explanation

The file procs in a cgroup directory contains the list of processes belonging to this cgroup. Each line in the file shows the PID of a process that is a member of the cgroup. A process can be moved to a cgroup by writing its PID into the cgroup's procs file. For example, to move the process with PID 24982 to the cgroup cg1, the following command can be used: echo 24982 > /sys/fs/cgroup/cg1/procs. The file procs is different from the file tasks, which lists the threads belonging to the cgroup. The file procs can be used to move all threads in a thread group at once, while the file tasks can be used to move individual threads.

Topics

#cgroups#process management#Linux namespaces#container isolation

Community Discussion

No community discussion yet for this question.

Full 305-300 Practice