You are not logged in.

#1 2023-07-13 07:16:27

happi0
Member
Registered: 2021-08-29
Posts: 14

Is "/sbin/init" a normal user process?

I read APUE, and it says "/sbin/init" is a normal user process?I was confused.

The init process never dies. It is a normal user process, not a system process within the kernel, like the swapper, although it does run with superuser privileges.

How should I understand, can someone help me?THANKS!

Offline

#2 2023-07-13 07:53:08

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 1,992
Website

Re: Is "/sbin/init" a normal user process?

Well, no. Firstly /sbin/init is just a binary.
That binary can be invoked, i.e. started via the kernel's "init=" parameter as the first process of the system.
That first process then runs with UID=0 and PID=1 and is called the "init process".
On modern Arch Linux systems the binary /sbin/init is, however, just a symlink to /usr/lib/systemd/systemd, which I for instance invoke directly via the said kernel paramter in my NVRAM's EFI loader config.

It certainly is not a kernel process in the sense that it is part of the running kernel.
It is insofar a user process as it is a process outside the kernel space that is assigned a user (UID=0 aka. root).

I hope that clears some things up.

Last edited by schard (2023-07-13 07:53:32)


macro_rules! yolo { { $($tokens:tt)* } => { unsafe { $($tokens)* } }; }

Offline

#3 2023-07-13 08:09:21

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,982

Re: Is "/sbin/init" a normal user process?

Does Advanced Programming in the UNIX Environment only distinguish between user and system processes ?

https://wiki.archlinux.org/title/Arch_boot_process and https://wiki.archlinux.org/title/Init should help to understand more about the init process..


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2023-07-13 13:13:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,579
Website

Re: Is "/sbin/init" a normal user process?

Both posts above are giving good information - but it's not clear what information you seek.  You say you are confused - and each of the responses above make assumptions about what you might be confused about and then try to address that.  How about you actually tell us what your confusion is - what about that quote do you not understand?

I could also speculate on the source of your confusion and suggest that APUE could have been more clear if they said that it is a "normal userspace process" rather than "a normal user process".  As the word "user" can mean different things in different contexts (just like "root" does: it has at least three different meanings in root user, root filesystem (i.e., /), and root directory (i.e. /root/)).  But this point only addresses one possible confusion that I'm making a wild guess may be what you are stumbling on.  It'd be better, though, for you to just tell us what confuses you.

Last edited by Trilby (2023-07-13 13:17:46)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB