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