Starting Apache: delay to when users/groups are fully loaded?
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 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@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@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/launchd-dev
On 1 Dec 2012, at 08:02, Илья Кулаков <kulakov.ilya@gmail.com> wrote:
launchd does not allow you to configure dependencies.
Right, because in a launchd world the system is supposed to infer dependencies from API calls. What's interesting here is that Apache has managed to detect the absence of a group without call any of the APIs that would block it until the directory services infrastructure has come up enough to see that group.
Nov 30 17:26:54 posh com.panic.httpd[120]: httpd: bad group name web
Is "web" the group name? If so, that's not a built-in one. Which directory node is it coming from? Have you look at how Apache is testing for the presence of this group? Do you know why this is cause problems for your instance of Apache and not for the system one? Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
participants (3)
-
Cabel Sasser
-
Quinn "The Eskimo!"
-
Илья Кулаков