Because launchd runs as root, it can create low-numbered TCP/IP listen sockets and hand them off to the daemon.
Provides system administrators with a central place to manage daemons on the system.Įliminates the primary reason for running daemons as root. Simplifies the process of making a daemon by handling many of the standard housekeeping chores normally associated with launching a daemon. In addition to the launch-on-demand feature, launchd provides the following benefits to daemon developers: If a daemon shuts itself down, launchd once again relaunches it as needed to process requests.
Grant tibetan dictionary for mac free#
Once launched, the daemon can continue running or shut itself down to free up the memory and resources it holds. When a client sends a request to the port, launchd may have to launch the daemon so that it can handle the request. In reality, the daemon may or may not be running. To client programs, the port representing your daemon’s service is always available and ready to handle requests. What launchd provides is a harness for launching your daemon as needed. With the introduction of launchd in OS X v10.4, an effort was made to improve the steps needed to launch and maintain daemons. If you do not make your daemon be launched on demand, you will have to handle these dependencies in another way, such as by using the legacy startup item mechanism. The launchd daemon was designed to remove the need for dependency ordering among daemons. In addition, launchd can start jobs at timed intervals.Īlthough launchd supports non-launch-on-demand daemons, this use is not recommended. The preferred method is on-demand launching, but launchd can launch daemons that run continuously, and can replace inetdfor launching inetd-style daemons. There are four ways to launch daemons using launchd. Thus, the term “daemon” is used generically in this section to encompass both system-level daemons and user agents except where otherwise noted. Unless otherwise noted, for the purposes of this chapter, the terms “daemon” and “agent” can be used interchangeably. A user agent is essentially identical to a daemon, but is specific to a given logged-in user and executes only while that user is logged in.
These per-user processes are referred to as user agents. If you are running per-user background processes for OS X, launchd is also the preferred way to start these processes. It also improves the ability of administrators to manage the daemons running on a given system. Using launchd provides better performance and flexibility for daemons. If you are developing daemons to run on OS X, it is highly recommended that you design your daemons to be launchd compliant. Next Previous Creating Launch Daemons and Agents