Skip to Main Content
Mac OS X for Unix Geeks
book

Mac OS X for Unix Geeks

by Ernest E. Rothman, Brian Jepson
September 2002
Beginner to intermediate content levelBeginner to intermediate
216 pages
7h 43m
English
O'Reilly Media, Inc.
Content preview from Mac OS X for Unix Geeks

The rc Scripts

The init process launches the /etc/rc.boot and /etc/rc shell scripts to start the system. Both rc scripts (and all startup items) source the /etc/rc.common script, which sets the initial environment, defines some useful functions, and loads the /etc/hostconfig file. /etc/hostconfig controls which system services need to be started and defines such things as the AppleTalk hostname. Example 2-2 is an excerpt from the hostconfig file.

Example 2-2. A portion of /etc/hostconfig
SSHSERVER=-YES-
WEBSERVER=-YES-
APPLETALK_HOSTNAME=*427269616e204a6570736f6ed57320436f6d7075746572*

This excerpt shows that sshd and httpd will be started on “Brian Jepson’s Computer” (the decoded AppleTalk hostname) at startup. The AppleTalk hostname is encoded as a sequence of hexadecimal bytes (for example, 42=B, 72=r, 69=i, 61=a, and 6e=n).

After rc.boot has loaded in values from /etc/rc.common, it determines whether the system is booting from a CD. Next, rc.boot tests to see whether the system is booting in single-user mode. If the system is neither in single-user mode nor booting from a CD, then rc.boot performs a check of the filesystem (fsck). If the fsck fails, then rc.boot tries an fsck -y, which assumes a “Yes” answer to all the questions that fsck asks. If that fails, the system reboots (and may end up trying an fsck -y over and over again).

Tip

If you find yourself in an fsck loop, you should boot from the Mac OS X installation CD. You can boot from a CD by holding down the C key ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mac OS X For Unix Geeks, 4th Edition

Mac OS X For Unix Geeks, 4th Edition

Ernest E. Rothman, Rich Rosen, Brian Jepson
Mac OS X Hacks

Mac OS X Hacks

Kevin Hemenway, Rael Dornfest
Mac OS X in a Nutshell

Mac OS X in a Nutshell

Jason McIntosh, Chuck Toporek, Chris Stone

Publisher Resources

ISBN: 0596003560Errata Page