Linux in a Nutshell, Third Edition
by Ellen Siever, Stephen Spainhour, Jessica P. Hekman, Stephen Figgins
Name
init
Synopsis
init [option] [runlevel]
Description
System administration command.
Option
- -t seconds
When changing runlevels, send SIGKILL seconds after SIGTERM. Default is 20.
Files
init is the first process run by any Unix machine at boot time. It verifies the integrity of all filesystems and then creates other processes, using fork and exec, as specified by /etc/inittab. Which processes may be run are controlled by runlevel. All process terminations are recorded in /var/run/utmp and /var/log/wtmp. When the runlevel changes, init sends SIGTERM and then, after 20 seconds, SIGKILL to all processes that cannot be run in the new runlevel.
Runlevels
The current runlevel may be changed by telinit, which is often just a link to init. The default runlevels vary from distribution to distribution, but these are standard:
- 0
Halt the system.
- 1, s, S
Single-user mode.
- 6
Reboot the system.
- q, Q
Reread /etc/inittab.
Check the /etc/inittab file for runlevels on your system.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access