Why I don't trust transitions to single-user mode
When I talked about how avoiding reboots should not become a fetish I mentioned that I trusted rebooting a server more than bringing it to single user mode and then back to multiuser. Today I feel like amplifying this.
The simple version is that it's easy for omissions to hide in the
'stop' handling of services if they are not normally stopped and
restarted. When you reboot the machine after the 'stop' stuff runs,
the reboot hides these errors. If you don't quite completely clean
/var/run or reset your state or whatever, well, rebooting the
machine wipes all of that away and gives your 'start' scripts a
clean slate. Similarly, there's potential issues in that transitioning
from single user to multiuser mode doesn't have quite the same
environment as booting the system or restarting a service in multiuser
mode; bugs and omissions could lurk here too.
This is a specific instance of a general cautious view I have. There is nothing that forces a multiuser to single user to back to multiuser transition to be correct, since it's not done very often. Therefor I assume that there at least could be omissions. Of course these omissions are bugs, but that's cold comfort if things don't work right.
I also wouldn't be surprised if some services don't even bother to have real 'stop' actions. There are certainly some boot time actions that don't really have a clear inverse, and in general if you expect a service to never be restarted it's at least tempting to not go through all of the hassle. Perhaps I'm being biased by some of our local init service scripts which omit 'stop' actions for this reason.
(A related issue with single user mode is an increasing disagreement
between various systems about just what services should be running
in it. There was a day when single user mode just
disks, mounted at least some local filesystems, and gave you a
shell. Those days are long over; at this point any number of things
may wind up running in order to provide what are considered necessary
Comments on this page:Written on 24 March 2014.