Reply to post: Re: Honest inquiry

systemd-free Devuan Linux hits version 1.0.0

Peter Gathercole Silver badge

Re: Honest inquiry

Back on my own machine. V7x86 partition fired up.

/etc/init is a binary that is run from inside main.c, and it is crafted as process 1 (the source refers to process 0 as being the scheduler, and is just a loop that sleeps on a timer interrupt, and presumably inspects the process table to schedule the other processes).

The source for the Edition 7 init is very simple. It handles single and multi-user modes, and runs /etc/rc, and also handles respawning the getty processes (controlled by the entries in /etc/ttys) as they are used by users logging on and off. It's written as an infinite loop with a wait in it. The wait will return every time a process terminates. It then puts a record in utmp, and if the process was a getty or whatever getty exec'd, it respawns the getty.

Other than that, it does very little. The processes that run at boot are actually started by the /etc/rc script, and that is a simple top-to- bottom script that mounts the other filesystems, starts cron and the update process that periodically.

So much more simple that the SysVinit that implements inittab. I don't have access to any Bell Labs or AT&T source later than Edition 7, although I guess I could look at BSD, but that may not give any insight to when the full-blown SysVinit appeared.

I believe that the Edition 8 source may now be at TUHS (at I must check it out, although this is only related to SysV through the common ancestor of Edition 7.

BTW, Correction to my previous post. Lions is spelt Lions, not Lyons.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019