The Un-Official Proxomitron Forum

Full Version: OS X launch support
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

fuzzy

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.

fuzzy

BFilter rulz Rocker !!!
If I use launchd, that would break compatibility with Panther. I plan supporting Panther at least until 10.5 is released. In fact, my laptop is still running it.
What is the advantage of using it anyway?

fuzzy

Well, used this way... none. But On-Demand launching saves memory when it's not used.

...only a suggestion. (Apple tries to merge standard cron, rc and at programs into one, what IMHO isn't a bad idea.)
After years of using Privoxy, I discovered it's not compatible with Mac OS X 10.6 (aka Snow Leopard). Worse, Privoxy's developers no longer support OS X at all. As soon as I switched to BFilter -- which works fine in 10.6 -- I realized it's what I should have been using all along. My only complaint: BFilter installs itself in /Library/StartupItems/ which is deprecated in 10.6. So I tried a little hack based on fuzzy's post. All it took was to edit the BFilter startup script to change the path to BFilterDaemon to /usr/local/sbin and then to write a launch agent plist stored in /Library/LaunchDaemons. Hope I'm not treading on anyone's copyright -- but it works great.
Reference URL's