problem with dhcpd and daemondo
I recently acquired a new Mac mini and installed the latest Macports. After installing dhcpd I discovered that it will not automatically start at boot. This worked in the past, as I recently sold a Mac mini G4 that had dhcpd running via Macports. Unfortunately I don't have a backup to see what changed between latest dhcpd and older Macports/dhcpd. Here is the error message in system.log: Oct 14 19:12:49 localhost dhcpd: Not configured to listen on any interfaces! ... ... Oct 14 19:12:49 localhost dhcpd: Oct 14 19:12:49 localhost dhcpd: exiting. Which appears to indicate that dhcpd is being started before the network interface en0 is brought up, or perhaps some other error. My temporary workaround is to login after booting and issue the following commands: launchctl unload -w /Library/LaunchDaemons/org.macports.dhcpd.plist launchctl load -w /Library/LaunchDaemons/org.macports.dhcpd.plist Now inside the plist file is a set of commands to start/stop/restart the dhcpd daemon: <?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>Debug</key> <false/> <key>Label</key> <string>org.macports.dhcpd</string> <key>OnDemand</key> <false/> <key>ProgramArguments</key> <array> <string>/opt/local/bin/daemondo</string> <string>--label=dhcpd</string> <string>--start-cmd</string> <string>/opt/local/etc/LaunchDaemons/org.macports.dhcpd/dhcpd.wrapper</string> <string>start</string> <string>;</string> <string>--stop-cmd</string> <string>/opt/local/etc/LaunchDaemons/org.macports.dhcpd/dhcpd.wrapper</string> <string>stop</string> <string>;</string> <string>--restart-cmd</string> <string>/opt/local/etc/LaunchDaemons/org.macports.dhcpd/dhcpd.wrapper</string> <string>restart</string> <string>;</string> <string>--pid=none</string> </array> <key>RunAtLoad</key> <false/> </dict> </plist> Can someone help explain how daemondo works and why it isn't starting dhcpd at boot? Thanks, Brian
Problem solved and now I want to know how to fix the portfile. But first let me explain the solution. I found this thread: http://lists.macosforge.org/pipermail/macports-users/2007-June/004009.html And changed /Library/LaunchDaemons/org.macports.dhcpd.plist from: <key>ProgramArguments</key> <array> <string>/opt/local/bin/daemondo</string> <string>--label=dhcpd</string> <string>--start-cmd</string> to this: <key>ProgramArguments</key> <array> <string>/opt/local/bin/daemondo</string> <string>--label=dhcpd</string> <string>--restart-netchange</string> <string>--start-cmd</string> Rebooted and that solved the problem. I'm guessing that Mac mini G4 was slower and therefore the race condition was never met and it worked on the older/slower Mac mini. As I rely on dhcpd my question is now how can the portfile be fixed? Brian
On Oct 17, 2007, at 14:47, BB wrote:
Problem solved and now I want to know how to fix the portfile. But first let me explain the solution.
I found this thread: http://lists.macosforge.org/pipermail/macports-users/2007-June/ 004009.html
And changed /Library/LaunchDaemons/org.macports.dhcpd.plist from:
<key>ProgramArguments</key> <array> <string>/opt/local/bin/daemondo</string> <string>--label=dhcpd</string> <string>--start-cmd</string>
to this:
<key>ProgramArguments</key> <array> <string>/opt/local/bin/daemondo</string> <string>--label=dhcpd</string> <string>--restart-netchange</string> <string>--start-cmd</string>
Rebooted and that solved the problem. I'm guessing that Mac mini G4 was slower and therefore the race condition was never met and it worked on the older/slower Mac mini.
As I rely on dhcpd my question is now how can the portfile be fixed?
See two messages later in that thread: http://lists.macosforge.org/pipermail/macports-users/2007-June/ 004011.html On Thu Jun 21 15:34:14 PDT 2007 James Berry wrote:
Well, currently we don't have any easy way to put that change into the portfile itself, and have it reflected down into the generated plist. Granted, we should. It's likely that the illustrated line would be useful in most networked daemons.
I'm not sure if a bug is filed in Trac. If not, you could file it and point back at this and the previous mail threads. Patches to MacPorts base would of course be welcome as well.
On 10/17/07, Ryan Schmidt <ryandesign@macports.org> wrote:
I'm not sure if a bug is filed in Trac. If not, you could file it and
My bug report: http://trac.macports.org/projects/macports/ticket/12931
point back at this and the previous mail threads. Patches to MacPorts base would of course be welcome as well.
I looked at the base system source code and found the likely section of code that needs patching, however I don't have the Tcl skills to edit the code. Details in the bug report. Brian
participants (2)
-
BB
-
Ryan Schmidt