Re: Processes with hidden PID files in /proc

From: Jan Engelhardt
Date: Thu Dec 14 2006 - 12:11:54 EST



>Yesterday I discovered some processes that had a PPID which was not
>shown as a running process by "ps". Also an "ls /proc" did not show
>that PPID.
>
>I've Googled on this enough to find out that these are Linux threads,
>that "ps -m" will show them, that "ls -a /proc" will show /proc/.PPID,
>etc, but I'm still wondering what exact sequence of system calls will
>create a process like this?

It's all there:

18:10 ichi:/proc/3689 # l exe
lrwxrwxrwx 1 root root 0 Dec 14 08:02 exe -> /usr/sbin/named
18:10 ichi:/proc/3689 # l task
total 0
dr-xr-xr-x 6 named named 0 Dec 14 18:09 .
dr-xr-xr-x 5 named named 0 Dec 14 08:02 ..
dr-xr-xr-x 4 named named 0 Dec 14 18:09 3689
dr-xr-xr-x 4 named named 0 Dec 14 18:09 3690
dr-xr-xr-x 4 named named 0 Dec 14 18:09 3691
dr-xr-xr-x 4 named named 0 Dec 14 18:09 3692
18:10 ichi:/proc/3689 # l -d ../3692
dr-xr-xr-x 5 named named 0 Dec 14 18:09 ../3692
18:10 ichi:/proc/3689 # l .. | grep 3692

W.W.W.W.W.

Only "processes" are returned by readdir() on /proc, but every "thread"
(LWP) is still accessible.

-`J'
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/