Originally posted by oleid
View Post
and it's not in the kernel yet and it needs a user space helper
open local socket, fork, exec, read/write to socket (plus gettimeofday and maybe sleep, for timeout)
can also be over a file instead of socket
the process tracker will use proc events (notably fork and exit) + a client-server model over a local socket
the actual "tracking" will be just maintaining a list of PID's spawned from the starting process
so just an array of PID's where fork() will add a pid and exit() event will remove one
i got the client-server model in a couple of functions, the proc events netlink code from above and the rest on paper
one advantage over cgroups will be in that it can protect against fork bombs (by limiting max PID's that come from a program)
and another, more complicated to do, one will be that it can, in theory, make a genealogy tree of a process (in contrast to pstree)
i don't know of a problem that only systemd solves...
even more so as systemd uses the kernel to do almost all of the actual work
Comment