Welcome to the Linux Foundation Forum!

Process Monitoring: Customizing the PS Output

I am using Ubuntu 18 for my training. I have a question. I ran the command ps -elf and in the book it says this:

In my screenshot I see both 1 and 2. 1 belongs to /sbin/init maybe-ubiquity and 2 belongs to kthreadd.

Am I running some type of a hybrid type system?

Comments

  • Hi @hroberts65616 ,

    I did 'ps -elf' on an Ubuntu 18.04 system and I got one /sbin/init process only, and it's PID is 1. In your image it's not possible to see the column for the command, so I can't say what's the command for both lines. But what you are showing/pointing to is one process that has PPID (parent ID) 1, and another that has PPID 2, that's all.

    Now, the kthreadd process manages the dispatch of other kernel threads, that you can see between square brackets []. Perhaps reading the following document would help to clarify this:

    https://topic.alibabacloud.com/a/kthreadd-linux-process-2nd_1_16_30162820.html

    Regards,
    Luis.

  • coop
    coop Posts: 916

    your output is completely normal. I'm currently running a RHEL 8 system (which is essentially the same, all systemd systems are) and PID=1 is actually the /usr/lib/systemd/systemd binary. kthreadd is PID=2. So the explanation is:

    processes whose parent is still running and that parent is init have PPID=1

    processes whose parent is dead have been adopted by kthreadd and have PPID=2

    So all is just as it should be. Now if you are asking why some parents are dead and others are still alive that is depends.... :)

Categories

Upcoming Training