Is reboot the same as init 6 for ubuntu?
I'm running Ubuntu 12.04 on Amazon EC2. When ssh'ed into the box I can type
runlevel and I get:
man reboot I see that:
When called with --force or when in runlevel 0 or 6, this tool invokes the reboot(2) system call itself and directly reboots the system. Otherwise this simply invokes the shutdown(8) tool with the appropriate arguments.
If I read
man shutdown 8 I see:
shutdown arranges for the system to be brought down in a safe way. All logged-in users are notified that the system is going down and, within the last five minutes of TIME, new logins are prevented.
My basic understanding about the difference between
init 6 is:
- On other distros and perhaps older distros
rebootwould just unmount the disks and basically flick the power switch without running any shutdown scripts
init 6will run all of the shutdown scripts in
/etc/init/rc.*as it reduces system's runlevel
- On newer versions of Ubuntu the
-fwill run the shutdown command which does would basically do the same thing as
- It's probably better to get in the habit of using
init 6instead of
rebootas it is safer and would work better cross-distro, but the default behavior of
reboothas been changed to try and prevent errors / dataloss if someone does use it.
Is that about right? If not, what am I missing?