Starting and Stopping Linux
This sounds like such a simple thing that you might wonder why I am spending any time on it at all. After all, you turn on the power switch, sit back, and watch Linux come to life. Depending on the installation, you may have more than one boot option. The default will almost certainly be to take you into Linux. If you opted for a dual-boot system, you may have to select Linux from the boot menu.
The lesson here is simply this: because you do have options, take the time to read what's on the menu.
All right. Here is rule number one when it comes to shutting down your system. Never, ever simply power off the system. You must do a proper shutdown. Oh, and get an uninterruptible power supply (UPS) so that your system doesn't shut down accidentally. You do not need a UPS to run Linux. However, if you don't want a random power fluctuation or a three-second power outage to take down your system, the added protection of a UPS makes sense.
Linux is a multiuser, multiprocessing operating system. Even when it appears that nothing is happening, there can be a great deal going on. Your system is maintaining disk space, memory, and files. All this time, it is busy making notes on what is happening in terms of security, e-mail, errors, and so on. There may be open files or jobs running. A sudden stop as a result of pulling the plug can damage your file systems. A proper shutdown is essential. Even in the world of your old OS, you still had to do a proper shutdown—Linux is no different.
There are a few ways of shutting down your system. You start by logging off from your system. Make sure that you've closed all your applications and saved anything you might have been working on. Now, right-click on the desktop and select Logout from the popup menu. You should get something that looks similar to the screen shown in Figure 3-4.
Figure 3-4. Logoff screen.
This particular logoff screen is from a SuSE system, but the types of options will be similar regardless of what system you are on. At this point, select “Turn off computer.” There's rarely any need for a “Restart computer” in the Linux world—when you shut down, it's usually because you intend to power off the system.
You can also log out from the command line, but it must be done from the root login. From a terminal window, switch to root with "su - root" (you'll be prompted for the password), and type the following:
shutdown –h now
When shutdown is called with the -h option, it is another way of saying, “Shut the system down and keep it down.” On some systems (and with proper hardware), this option will power off the system after it is down. Another option is to type the following:
shutdown –r now
The -r option tells Linux to reboot immediately after a shutdown. A reboot option is usually used after a kernel rebuild.