1 This is a launchd item for Mac OS X and Mac OS X Server.
2 For more information about launchd, the
3 "System wide and per-user daemon/agent manager", see the launchd
4 man page, or the wikipedia page: http://en.wikipedia.org/wiki/Launchd
6 This launchd item uses the following flags:
7 --keep-in-foreground - this is crucial for use with launchd
8 --log-queries - this is optional and you can remove it
9 --log-facility=/var/log/dnsmasq.log - again optional instead of system.log
11 To use this launchd item for dnsmasq:
13 If you don't already have a folder /Library/LaunchDaemons, then create one:
14 sudo mkdir /Library/LaunchDaemons
15 sudo chown root:admin /Library/LaunchDaemons
16 sudo chmod 775 /Library/LaunchDaemons
18 Copy uk.org.thekelleys.dnsmasq.plist there and then set ownership/permissions:
19 sudo cp uk.org.thekelleys.dnsmasq.plist /Library/LaunchDaemons/
20 sudo chown root:admin /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist
21 sudo chmod 644 /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist
23 Optionally, edit your dnsmasq configuration file to your liking.
25 To start the launchd job, which starts dnsmaq, reboot or use the command:
26 sudo launchctl load /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist
28 To stop the launchd job, which stops dnsmasq, use the command:
29 sudo launchctl unload /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist
31 If you want to permanently stop the launchd job, so it doesn't start the job even after a reboot, use the following command:
32 sudo launchctl unload -w /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist
34 If you make a change to the configuration file, you should relaunch dnsmasq;
35 to do this unload and then load again:
37 sudo launchctl unload /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist
38 sudo launchctl load /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist