On Saturday, September 17, 2011 08:45:15 AM Joost Roeleveld wrote: > On Friday, September 16, 2011 10:53:47 AM Canek Peláez Valdés wrote: > > I think systemd gives you that in servers. With OpenRC and Apache with > > user CGI scripts, ¿do you know how to list the httpd daemon spawned > > processes, and only those? Remember that a CGI script can double fork. > > > > With systemd is a matter of: > > > > systemctl status apache-httpd.service > > Did you look at the output of pstree? > Try "pstree -pu" and you see all the PIDs and whenever there is a "user- > switch", it also lists the new user. >
Had a quick look to get a more detailed list: Specifically only for apache: # pstree -pu `cat /var/run/apache2.pid` "/var/run/apache2.pid" gets the PID for the parent process automatically. With this list, I can get a more detailed picture of which process calls which child-process / thread and which user(s) are used for which process. -- Joost