site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com —IWC _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... On Dec 11, 2006, at 1:25 PM, Ernesto Corvi wrote: I have a daemon I originally wrote for Linux and FreeBSD that I want to run on the Mac now. The daemon runs at startup, so I'm using the 'RunAtLoad' key. I even wrote a small Cocoa PreferencePane to be able to start/stop the daemon using launchctl load/unload, but I seem to be having a small problem. If I start it with launchctl, then issue a kill -TERM pid (just to simulate a crash), launchd doesn't seem to know the process died. It won't reload the process, and trying to issue a load command returns that the process is already loaded (a simple 'ps' shows the process is, in fact, not running). Ideally, I would like launchd to automatically know the process died, and have it relaunch it. But if that cannot be done, at the very least I would like it to be aware when a process it manages stopped running. Am I doing something wrong? Am I missing a key on the plist? Probably the OnDemand key. It's easy to miss while running through launchd.plist(5). You'll want to set it to false. This email sent to site_archiver@lists.apple.com