daemondo defeats purpose of launchd?

James Berry jberry at macports.org
Wed Sep 5 12:18:54 PDT 2007


On Sep 1, 2007, at 9:47 AM, 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.

Hi Chris et al,

As wrote in another email just now on this thread, daemondo isn't  
strictly needed when there is a good executable path to use.

We should probably support a path through startupitem keys that would  
allow us to get daemondo out of the picture at least for the case of  
inetd, though perhaps it's better then to just not use the  
startupitem keys and to supply a launchd.plist instead?

If we need to add support for additional launchd.plist keys such as  
user to be used in our generated launchd.plist then we should do so.  
Whether or not we also want to add support for the --restart- 
netchange of daemondo is another open question.

James



>
> There's also no support for inetd, which I use for rsyncd and cups- 
> lpd--but these are not things I expect MacPorts to install scripts  
> for anyway.
>
>
> Chris
>
> [1] http://xml.sfiera.net/
> _______________________________________________
> macports-dev mailing list
> macports-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo/macports-dev




More information about the macports-dev mailing list