5 Darkstat run smoothly on MacOS, as a service using the Apple standard manager, launchd, or as a simple process. In any cases, the usual requirements are used for accessing network interfaces and ports than for other UNIX platforms.
7 In order to use darkstat as a system service, we have to tell launchd the necessary informations about the new service we want it to manage.
9 A configuration file (cx.ath.darkstat) has already been prepared, you just have to put it into the appropriate directory and to activate it. The configuration has been set-up for listening on the "en0" (ethernet) network interface, and to run darkstat with a nice of 1.
17 Procedure for installing the service's configuration:
19 1) Edit the file "cx.ath.darkstat" for specifying the full access path to darkstat:
20 if you are using the macports distribution, use "/opt/local/sbin/darkstat"
21 if you are using the fink distribution, use "/sw/sbin/darkstat"
22 if you are using a manual installation, it is up to you.
24 2) Copy the configuration file:
25 sudo cp cx.ath.darkstat /Library/LaunchDaemons/
26 sudo chown root:wheel /Library/LaunchDaemons/cx.ath.darkstat
27 sudo chmod 644 /Library/LaunchDaemons/cx.ath.darkstat
30 sudo launchctl load /Library/LaunchDaemons/cx.ath.darkstat
32 From now, darkstat is under the control of launchd and will be started at boot time.
36 +------------------------+
37 | Desactivating darkstat |
38 +------------------------+
40 For deactivating darkstat until the next boot, you can use the command: sudo launchctl unload /Library/LaunchDaemons/cx.ath.darkstat
42 For permanently deactivating darkstat, you can use one of the two following solutions:
44 1) using the command: sudo launchctl unload -w /Library/LaunchDaemons/cx.ath.darkstat
45 The "-w" option will modify the configuration file, adding a key forbidding the activation of the service.
47 In order to reactivate the service, you will have to use the command: sudo launchctl load -w /Library/LaunchDaemons/cx.ath.darkstat
48 The "-w" option will modify the configuration file, removing a key forbidding the activation of the service.
50 2) simply remove the file /Library/LaunchDaemons/cx.ath.darkstat
58 Suggested further readings:
59 - darkstat: man 1 darkstat
60 - launchctl, the control tool for launchd: man 1 launchctl
61 - launchd service configuration: man 5 launchd.plist
62 - using nice: man 1 nice
66 Damien Clauzel, Damien@Clauzel.nom.fr