beautypg.com

Daemon overview, Viewing running daemons, Using launchd for daemon control – Apple Mac OS X Server (Version 10.6 Snow Leopard) User Manual

Page 169: 169 daemon overview 169

background image

Chapter 7

Ongoing System Management

169

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