BIND startup...

Daniel J. Luke dluke at geeklair.net
Wed Nov 12 14:06:39 PST 2008


On Nov 12, 2008, at 3:25 PM, Jeff Justice wrote:
> To start BIND, I used launchctl load -w /Library/LaunchDaemons/ 
> org.macports.bind9.plist
>
> By doing this, I understand it creates a launchdaemon that keeps  
> BIND running.  However this appears to negate the use of the rndc  
> commands for starting and stopping the server as the launchdaemon  
> keeps trying to relaunch BIND after it is stopped with rndc.

That's correct.

> So, if I want control over starting/stopping BIND, but I want it to  
> start on boot, what is the best way to accomplish this?  Is there a  
> way to configure the launchdaemon to not relaunch BIND if it is  
> stopped, but only on reboot?

You could write a new launchd plist that only started bind once and  
use it instead. This would negate the automatic restart on crash  
feature of launchd however.

> I guess what I'm trying to get at is that I need a way to stop the  
> server while I work on it, but I do want the launchdaemon to keep  
> BIND alive if it should crash.


You can use launchd do do this:

`sudo launchctl unload /Library/LaunchDaemons/ 
org.macports.bind9.plist` will stop bind and
`sudo launchctl unload /Library/LaunchDaemons/ 
org.macports.bind9.plist` will start it again (notice the lack of -w,  
which means if you stop bind and restart, bind will be started on boot  
since you didn't have launchd write out the unload to the plist).

Check out the launchctl man page and/or the apple launchd  
documentation if you want more details on how launchd works.
--
Daniel J. Luke
+========================================================+
| *---------------- dluke at geeklair.net ----------------* |
| *-------------- http://www.geeklair.net -------------* |
+========================================================+
|   Opinions expressed are mine and do not necessarily   |
|          reflect the opinions of my employer.          |
+========================================================+



-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20081112/d63bcf8a/attachment.bin>


More information about the macports-users mailing list