At your Runlevel

Earlier, A New HopeI was reminded of the typical run-levels on Linux systems, particularly on Debian-flavoured distributions. For future reference1:

  • Run level 0: System Halt
  • Run level 1: Single User/No networking (“Safe Mode” for Windows connoisseurs). In this mode daemons won’t be started.
  • Run level 2: Full Multi-user
  • Run level 3: Full Multi-user, same as two, but commonly used for text console login.
  • Run level 4: Full Multi-user
  • Run level 5: Full Multi-user, same as two, but commonly used for full-blown X-Server login.
  • Run level 6: System Reboot

There are specific commands to tell the environment to go to any of the earlier mentioned run-levels: however, as a normal user, the only way you generally switch level is via the ‘shutdown’ command (which as you guess either changes the run-level to 0 or 6. As the Debian Administration mentions, this is probably a command you want to learn by heart. Well, at least you should be familiar with the following command:

shutdown -h “now”

So, yeah, you have a daemon that got stuck during boot-up and how do you get into Run-level 1? Most Linux distros nowadays use GRUB as a bootloader (without peeking at Wikipedia, I think that stands for ‘Grand Unified Bootloader’), so if you’re a LILO user, sorry. Anyway: GRUB allows you to interrupt the boot-process and issue extra command-line parameters (press the ‘e’ key) before booting the computer. On simple Debian-based systems (Damn Small Linux): To boot right into Run level 1 the only thing you need to do is to replace the last number of the main boot command (‘kernel’) to a 1 (most likely it will say either 3 or 5). You can also append ‘single’ to the commandline, apparently. Debian-based flavours that run X-Server and that (Ubuntu fellows, I look at you): to boot into single mode, just press ESC and select (any) of the recovery modes presented to you by GRUB.

1 Nowadays, Debian Administration is not one of the most stable sites it appears…