Linux – How to shut down or reboot a machine? [on different OSes]

aixhp-uxlinuxshutdownsolaris

What parameters do the "shutdown" command [or other command?] NEED, TO BE SURE that the machine reboots or shuts down for SURE?

e.x.: version for Linux:

# cat /etc/SuSE-release
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 4

e.x.: version for AIX:

$ oslevel -s
6100-05-01-1016

e.x.: version for SunOS:

cat /etc/release
                  Solaris 10 10/09 s10s_u8wos_08a SPARC
       Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
                    Use is subject to license terms.
                       Assembled 16 September 2009
# 

e.x.: version for HP-UX:

uname -r
B.11.11

Please share experiences also with shutdown/reboot [command didn't worked, because machine was unreachable, because it got "stuck" somewhere when trying to reboot – I mean not after rebooting, "before" the machine get's rebooted…so that why can it stuck in the start/middle of reboot the process ]

Best Answer

Check the Rosetta stone for Unix for ways to perform common administration tasks on various unix variants. When it comes to shutting the system down, most systems provide two commands: one that stops the system services cleanly (going throough a shutdown runlevel, on variants that have runlevels), and one that stops the world and reboots instantly (possibly without even unmounting filesystems cleanly). You should always try the clean variant first, and only use the instant variant if the clean variant failed; if you use the instant variant, first shut down as many things as you can manually.

I believe all the systems you list require proper arguments to shutdown to shut the system down cleanly and reboot. Check the shutdown(8) or shutdown(1m) manual page on each system.

A shutdown can fail only if one of the system services, the kernel or the hardware is buggy. Most OSes will forcibly shut the system down even if some system service fails to stop cleanly. If you have a kernel bug or hardware trouble (such as a misbehaving disk), it's possible for the shutdown process to fail. There isn't much recourse in that case: hardware failures often require physical intervention. A watchdog may help, if you need to reboot the system in case of a hardware failure.

Related Question