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.

  • 1
    Note that this doesn't apply to most modern Linux systems. This only applies to Sysvinit systems and possibly upstart – jordanm Mar 11 '17 at 4:16
  • Please get familiar with our FAQ. Requests for learning materials are out of topic. – Rui F Ribeiro Mar 11 '17 at 12:17

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:

  • 0 - Shut down / System halt
  • 1 - Single User mode
  • 2 - Reserved for administrative use
  • 3 - Multi-User mode with networking and services
  • 4 - Reserved for administrative use
  • 5 - Multi-User mode with networking, services, and GUI login daemon
  • 6 - Reboot

The init command tells the system to move to the specified runlevel. Because 6 is the commonly defined runlevel used to reboot the host, and init 6 (or telinit 6) is the means to go to that runlevel, this is why init 6 is generally understood to be a reboot 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.

  • 4
    A question that talks about Unix history and that invokes the name of Bach is not really well answered by an answer that doesn't mention anything outwith the world of Linux. Just for starters, one could mention that the premise of the question is wrong, and run level 6 is/was not universally reboot. – JdeBP Mar 11 '17 at 9:18
  • I will point out that "generally" was used in my answer specifically because it does not mean "universally". – DopeGhoti Mar 11 '17 at 16:08
  • Thanks for the answer! I was searching the historical reasons and I guess from your answer and others that is due mostly because a list/order reason. Also the rest of answer is useful for me! :-) – replicantech Mar 12 '17 at 10:03

The first appearance of System V style init was in SVR3 in the early eighties, before that AT&T Unix took no arguments.

Out of the box, there was not init 0 nor init 6 configured; only init 1 for single user mode and init 2 for multi user mode.

System administrators were free to use whatever they want with the extra run levels.

With SVR4, run level standardized to these values:

  • s : single user
  • 0 : halt/poweroff
  • 1 : one user mode (!= single user which was more a recovery/admin mode)
  • 2 : multi user (machine is a client)
  • 3 : multi user; distributed mode (machine is a server)
  • 4 : unassigned
  • 5 : diags
  • 6 : reboot

My best guess is that 6 was chosen because no requirement for an extra unassigned run level was envisioned.

All of this happened before Gnu/Linux was released so anything Linux related is irrelevant.

  • All this tended to also be linked to various licensing options (and costs), hence perhaps the difference between runlevels 1 and 2 — you could buy Unix licenses for single-user systems (perhaps you still can...). – Stephen Kitt Mar 14 '17 at 12:12

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.