[launchd-dev] Starting Apache: delay to when users/groups are fully loaded?

Илья Кулаков kulakov.ilya at gmail.com
Sat Dec 1 00:02:28 PST 2012


launchd does not allow you to configure dependencies.
You may try to play with KeepAlive. As I remember, if you just set it to true, it will restart your job after 10 seconds if it's exited with exit status of non-zero.


On 01.12.2012, at 9:33, Cabel Sasser <cabel at panic.com> wrote:

> Hey Guys,
> 
> We're launching our own httpd via a launchd file on startup.
> 
> However, here's the result:
> 
> 	Nov 30 17:26:54 posh com.panic.httpd[120]: httpd: bad group name web
> 
> If we "launchctl start" this same file a few seconds later, it works fine! So it appears that httpd is trying to run before Open Directory or something has fully loaded all of the user/group data…?
> 
> What's the best course of action for us? Is there a way to delay a launchd item, or wait, or anything? We're tired of manually starting apache every time the server reboots. :)
> 
> (Attached find the .plist file in question.)
> 
> Thanks,
> Cabel
> 
> ---
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
> <plist version="1.0">
> <dict>
>       <key>Disabled</key>
>       <false/>
>       <key>Label</key>
>       <string>com.panic.httpd</string>
>       <key>ProgramArguments</key>
>       <array>
>               <string>/usr/local/apache2/bin/httpd</string>
>               <string>-D</string>
>               <string>FOREGROUND</string>
>       </array>
>       <key>RunAtLoad</key>
>       <true/>
>       <key>KeepAlive</key>
>       <false/>
> </dict>
> </plist>
> _______________________________________________
> launchd-dev mailing list
> launchd-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo/launchd-dev



More information about the launchd-dev mailing list