daemondo defeats purpose of launchd?

Ryan Schmidt ryandesign at macports.org
Sat Sep 1 13:49:34 PDT 2007

On Sep 1, 2007, at 11:47, Chris Pickel wrote:

> On 01 Sep, 2007, at 4:35, Ryan Schmidt wrote:
>> I have this problem: the lighttpd web server on my MacBook Pro  
>> unexpectedly dies rather frequently (much more frequently than it  
>> did on my PowerBook). When this happens, the daemondo process is  
>> still there, and I have to use launchctl to unload and then load  
>> the lighttpd plist to get the server running again.
>> The point of launchd is that it notices when processes  
>> unexpectedly quit, and restarts them automatically so close to no  
>> downtime is observed. But launchd is monitoring daemondo, which  
>> does not exit, so launchd does not restart anything. And daemondo  
>> doesn't seem to have the same process-death-noticing feature so  
>> daemondo is not automatically restarting the failed lighttpd.
> Agreed. I try to avoid daemondo when possible. When it isn't  
> possible, daemondo is an indispensable tool, but it turns out that  
> for most cases, it's possible to avoid it. I've written many  
> launchd scripts on my own, several of which I've put online [1].
> It's possible to make launchd scripts similar to these in MacPorts  
> via startupitem.executable, but currently, the startupitem.*  
> commands in MacPorts do not support setting the "User" key. For  
> lighttpd, that's not necessary; it starts as root so it can listen  
> on the privileged port 80, then drops privileges. For mysql,  
> though, it's pretty important.

Thanks, I didn't even know about startupitem.executable. According to  
the new guide, it's the preferred startupitem method, but only 10  
ports currently use it! I'll have to look into it.

More information about the macports-dev mailing list