fuzzy
Mar. 04, 2006, 03:07 PM
Under OS X, the recommended way launching daemons is launchd(8). BFilter's installer could install the daemon in the standard unix paths (/usr/local/sbin/bfilterd and /usr/local/etc/bfilter) and a file like that:
<?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>GroupName</key>
<string>daemon</string> //write permissions for /private/var/run
<key>Label</key>
<string>org.jart.bfilter</string>//or what you like
<key>OnDemand</key> //start it on load and let it run (see also below)
<false/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/bfilterd</string>
<string>--confdir</string> //under OSX, the default dir is /Library/Application Support
<string>/usr/local/etc/bfilter</string>
<string>--pid</string>
<string>/private/var/run/bfilterd.pid</string>
</array>
<key>ServiceDescription</key>
<string>BFilter Web Proxy</string>
<key>UserName</key>
<string>daemon</string>
</dict>
</plist>
in /Library/LaunchDaemons/.
Additionally, if you use the launch(3) API, launchd could start bfilterd on demand, that is, when I browse to a page.
<?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>GroupName</key>
<string>daemon</string> //write permissions for /private/var/run
<key>Label</key>
<string>org.jart.bfilter</string>//or what you like
<key>OnDemand</key> //start it on load and let it run (see also below)
<false/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/bfilterd</string>
<string>--confdir</string> //under OSX, the default dir is /Library/Application Support
<string>/usr/local/etc/bfilter</string>
<string>--pid</string>
<string>/private/var/run/bfilterd.pid</string>
</array>
<key>ServiceDescription</key>
<string>BFilter Web Proxy</string>
<key>UserName</key>
<string>daemon</string>
</dict>
</plist>
in /Library/LaunchDaemons/.
Additionally, if you use the launch(3) API, launchd could start bfilterd on demand, that is, when I browse to a page.