Daemon Overview

By the time a user logs in to a Mac OS X system, a number of processes are running. Many of these processes are known as daemons. A daemon is a background process that provides a service to users. For example, the cupsd daemon coordinates printing requests, and the httpd daemon responds to requests for web pages.

Viewing Running Daemons

To see the daemons running on your system, use the Activity Monitor application (in /Applications/Utilities/). This application lets you view information about all processes, including their resource usage.

You will see the following daemons, regardless of what services are enabled: ÂÂ launchd (timed job and watchdog process)

ÂÂ servermgrd (administration tool interface process) ÂÂ serialnumberd (license compliance process)

ÂÂ mDNSresponder (local network service discovery process)

Using launchd for Daemon Control

Although some UNIX-like systems use other tools, Mac OS X Server uses a daemon called launchd to control process initialization and timed jobs.

The launchd daemon is the preferred alternative to the following common UNIX tools: init, rc, the init.d and rc.d scripts, SystemStarter, inetd and xinetd, atd, crond and watchdogd. All of these services should be considered deprecated and administrators are strongly encouraged to move process management duties to launchd.

There are two utilities in the launchd system: launchd daemon and launchctl utility.

The launchd daemon has also replaced init as the first process spawned in Mac OS X and is therefore responsible for starting the system at startup. The launchd daemon manages the daemons at both a system and user level. It can:

ÂÂ Start daemons on demand

ÂÂ Monitor daemons to make sure they keep running

Configuration files are used by launchd to define the parameters of services and daemons run. The configuration files are plist files stored in the LaunchAgents and LaunchDaemons subdirectories of the Library folders.

For more information about creating the launchd configuration files, see the following Developer Documentation page:

developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/Articles/

LaunchOnDemandDaemons.html

Chapter 7    Ongoing System Management

169

Page 169
Image 169
Apple 10.6 manual Daemon Overview, Viewing Running Daemons, Using launchd for Daemon Control