Alessandro Baggi <[email protected]> writes:

> Hi list,
> running this python3 script:
>
> #!/usr/bin/env python3
> import psutil
>
> pids = psutil.pids()
> for i in pids:
>     p = psutil.Process(i)
>     with p.oneshot():
>         print(str(i) + " " + p.name())
>
> The result start with:
>
> 0 swapper
> 1 init
> 536 smtpd
> 868 ksh
> ...
>
> This process does not appear in ps, top and htop.

You need to display kernel threads.

$ ps -p 0 -H
  PID     TID TT  STAT        TIME COMMAND
    0  100000 ??  DK       0:01.04 (swapper)

>
> How could be that there is a process with PID 0 before init?
> Probably I'm missing something about OpenBSD core.
>
> Can someone point me in the right direction?
>
> Thank you in advance.
>
> Alessandro.

Reply via email to