I would like to know why 6 is the number/code/signal associated with the reboot command in "init 6". I mean the history/stories/legend reasons, not in a technical way… If it was a "list related reason" or maybe a graphic thing about recursivity/circle-ouroboros/101 alike number.
I'm starting reading Design of the UNIX Operating System by Maurice Bach, but didn't find yet a reason or idea.
Best Answer
init 6
is the (or, a) reboot command because of the historical definitions of "runlevels", or general system states in which a host can be expected to be. These are generally defined as:The
init
command tells the system to move to the specified runlevel. Because6
is the commonly defined runlevel used to reboot the host, andinit 6
(ortelinit 6
) is the means to go to that runlevel, this is whyinit 6
is generally understood to be areboot
command.Technically speaking, because these can be redefined by a crafty or bored system administrator, it might be more advisable to use
shutdown -r
as a reboot command. This is in part because some distributions (e. g. Gentoo) eschew this convention entirely, and because of the proliferating deprecation of the System V Init system in favor of upstart and other "PID 1" daemons.