[launchd-dev] fork & exit in Shell Script (Revisited)

Quinn eskimo1 at apple.com
Mon Nov 10 06:35:16 PST 2008


At 13:56 -0500 5/11/08, Charles Darwin wrote:
>What is the proper way of shutting down a daemon? Another daemon 
>that runs a bit later?

OK, I'm really confused )-:

Let's start by agreeing on terminology.  I'm using the terms from 
TN2083.  Please familiarise yourself with them (specifically 
"daemon", "agent" and "background program").

<http://developer.apple.com/technotes/tn2005/tn2083.html>

If your background program is a "daemon" it is, by definition, not 
running on behalf of a specific user.  And thus it should not be 
affected by users logging in and out.

Furthermore, when you started talking about

>/Users/user/Library/LaunchDaemons/<label>.plist

I got even more confused because launchd doesn't load launchd daemons 
from the user's home directory.

Can you give me a quick overview of the what you want your background 
program to do?  I'm specifically interested in the context in which 
the process should run and its expected lifecycle.

S+E
-- 
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware


More information about the launchd-dev mailing list