Linux process hierarchies
Description
Implementing a solution that allows enforcing process hierarchies under Linux. (A process hierarchy is the tree formed by process parent / child relationship, and can be visualized through pstree.)
Use-cases
daemonizing (detection and preemption);
- stoping an entire process tree when the master terminates; (as in case of most DB systems that have one process per connection, or in case of web-servers when the master process dies;)
confining session processes; (as in case of a ssh session where the user forks processes in the background;)
Required skills
operating systems
medium
Linux
medium
programming
medium
Tasks
- analyzing the problem;
- identifying useful primitives;
- finding a proper solution;
- implementing the solution;
Hints
LXC;
clone with CLONE_NEWPID flag;
prctl with PR_SET_PDEATHSIG flag;
[PATCH] prctl: add PR_{SET,GET}_CHILD_SUBREAPER to allow simple process supervision;
[PATCH] exit: PR_SET_ANCHOR for marking processes as reapers for child processes;