sprocket i/o

thomas stromberg on technology, nature, and motorcycles

sprocket i/o header image 2

Privoxy sucks

June 5th, 2003 · Comments

image

When I upgraded to FreeBSD 5.1 at home the other day, I found Privoxy 3.0.0 and 3.0.2 would keep crashing at home, bringing our web browsing to a stand still. So, I present my new scripting masterpeice, named privoxy_sucks.sh. It forever (or until a file is created) goes into a loop, running privoxy until it crashes. When privoxy crashes, it restarts it, and makes squid re-establish it’s connections.

To pull off the squid notification, I had to go ahead and lookup how to do timed process execution in the background, since in order for this trick to work, I needed to run privoxy in foreground mode.

#!/bin/sh

while [ ! -f "/tmp/stop_privoxy" ]; do
  (sleep 2 && killall -HUP squid && echo "squid restarted")&
  su - proxy -c '/usr/local/sbin/privoxy --no-daemon' > /var/log/privoxy_output.log
  logger "privoxy died"
  echo "privoxy died"
done

Blah. I hate it when I enjoy a peice of server software that’s buggy.

Tags: technology

Viewing 12 Comments

 

Trackbacks

(Trackback URL)

close Reblog this comment
blog comments powered by Disqus