1

When I switch from runlevel 3 to runlevel 1 on my CentOS 6 box the output of runlevel is 1 S:

# runlevel
1 S

I'd expect the output to be 3 1. It's not a big deal but I'm keen to understand the logic behind the output. The man page for runlevel mentions that the Upstart init daemon works differently from SysVinit but as far as I'm aware runlevels 1 and S are always identical?

3

According to the runlevel(7) manual page, 1 and S are distinct:

Runlevel 1 is used to bring the system back down into single-user mode, after which the runlevel will be S.

and the CentOS 7 runlevel manual page (which deprecates the feature), says

runlevel prints the previous and current SysV runlevel if they are known.

so S being current, and 1 being previous is consistent with the other version of the manual page.

  • Thanks, I was looking at runlevel(8). I've now also learned (from the telinit man page) that it's possible to switch to runlevel S directly - but this wouldn't stop running processes. So that's what runlevel 1 does: it gracefully switches to single-user mode. – rkhff Feb 19 '16 at 2:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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