Logging Out and Shutting Down

When you’re done using your Macintosh, there are two ways to bring your session to a close: shutting down, and logging out.

Because Mac OS X is a multiple-user system and a server platform, you should choose to shut down the computer only if nobody else on your local network is using it or the services it provides. This includes both the other human users on the system, who might be logged into it remotely (see Section 7.5 in Chapter 7) or using network-shared volumes (see Section 13.7), as well as people or programs using any running network services (described in Chapter 7).

For example, if you are using printer sharing (as described in Chapter 8) to let other computers in your home or office use the printer connected to your Macintosh, then shutting down the Mac will also make that printer invisible to the other machines. The same goes for any web, mail, or other network services the machine may be running. On the flip side, if you are the sole account holder of your Mac, connect through the Internet via dial-up, and do not run any public network services, then it won’t hurt to shut down when you’re all done for the day.

Logging out is the better option for Macs that are shared by many users, or that act as network servers. When you log out (via

Logging Out and Shutting Down

Log Out, or Shift-

Logging Out and Shutting Down

-Q), then all the programs you launched since you logged in will terminate (Aqua applications all quit in the usual way, giving you a last chance to save changes), and you’ll be dropped back to the login screen. Behind that placid-looking screen, though, the computer remains busy because every other process—including those owned by the system itself, as opposed to you or any other human user—continues to work. So, if you activate printer sharing and then log out, printer sharing still works, so long as the computer stays on and connected to the printer (or until you or another user with admin privileges deactivates printer sharing). This is because the internal programs that make printer sharing (and web serving, mail delivery, and all other core network services) work belong to the system—the root user—not to any individual user.

Tip

If, for some reason, you have active logins to the machine from other computers on the network, they (and the programs running under them) won’t be affected by logging out of your account locally.

Actually, you have three choices (sort of). If you would like to remain logged in to the machine while you’re away, but prevent random people from sitting down and using your account, you can use a password-protected screen saver, as described in Section 5.2.1.7.

Note, however, that this isn’t considered very polite if multiple people have accounts on the machine, since nobody will be able to get past the screen saver and log in as themselves without knowing your password. In this case, it’s probably better to avoid the spite of your friends, family, or coworkers and just log out.

If this does happen, a Unix-savvy user with admin privileges can circumvent the screen saver by ssh-ing into the Mac from some other computer and forcibly killing the screen saver. sudo killall ScreenSaverEngin will do the trick nicely (yes, that’s spelled correctly—Darwin commands have a 16-character limit), or even the forgetful user’s entire login session. But this is also rather impolite. Again, better to avoid the issue entirely.

Get Mac OS X in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.