Init is the mother of all processes — it is the first
process a UNIX® system starts up and it manages all runlevel
changes and essential programs (
getty, and, on some systems
xdm.) It reads the file
/etc/inittab to find out
what processes to run and when to run them.
The Mastodon init setup is a service based one, where each init script starts a particular system service and refers to the other services by name. init maintains an incore registry of active services — each init script queries this database to see if its prerequisites are running and starts them if they aren’t.
Init puts the system into one of 4 different runlevels:
rrunlevel, except that it will go back into multiuser mode if you press a key at the **system halted** prompt.
The init package comes with the following programs:
shutdownhalts or reboots the system by either telling
initto change to the appropriate runlevel or by just blindly taking the machine down.
wallwrites a message to everyone on the system.
mesgsets your terminal to allow or deny messages.
showregshows all the processes currently registered.
reboot) halt (and reboot) the system, either by telling
initto go to runlevel
r) or by bringing down the system by themselves.
initservice registry for a process, and if not found, starts that process and registers it. Need assumes that your system has the init scripts in the directories
runleveldisplays the current runlevel.
initwhat runlevel you wish to change to. It is also used to tell init to reread
/etc/inittabafter it’s been changed.
shutdownto not ask for a message unless you give the
-mflag and checks in a fix to stop it from getting confused about how long to wait before entering OhMyGodProcessesWon'tStopTimeToPanicNow! mode during shutdown.