privoxy: bump to version 3.0.24

* upstream to Privoxy 3.0.24
* add facility to set compile options
* add file list to be saved on sysupgrade
* fixed PKG_MAINTAINER string
* add port 8118 used by privoxy to /etc/services
* new "boot_delay" option (default 10 seconds) to wait for interfaces to come up before hotplug restarts are enabled

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
This commit is contained in:
Christian Schoenebeck
2016-02-07 21:52:02 +01:00
parent 6d0f8aaef5
commit ba929dd1f7
5 changed files with 228 additions and 33 deletions
+33 -14
View File
@@ -50,6 +50,17 @@ _uci2conf() {
echo '### SEE /etc/config/privoxy INSTEAD' >> $CFGTEMP
echo '' >> $CFGTEMP
# logdir and logfile
# privoxy needs read/write access
_LOGDIR=$(uci -q get privoxy.privoxy.logdir) || _LOGDIR="/var/log"
_LOGFILE=$(uci -q get privoxy.privoxy.logfile) || _LOGFILE="privoxy.log"
mkdir -m0755 -p $_LOGDIR
touch $_LOGDIR/$_LOGFILE
chmod 664 $_LOGDIR/$_LOGFILE
chown privoxy:privoxy $_LOGDIR/$_LOGFILE
echo -e "logdir\t$_LOGDIR" >> $CFGTEMP
echo -e "logfile\t$_LOGFILE" >> $CFGTEMP
# confdir
# privoxy needs read access (possibly write access)
_CONFDIR=$(uci -q get privoxy.privoxy.confdir) || _CONFDIR="/etc/privoxy"
@@ -72,17 +83,6 @@ _uci2conf() {
echo -e "templdir\t$_TEMPLDIR" >> $CFGTEMP
fi
# logdir and logfile
# privoxy needs read/write access
_LOGDIR=$(uci -q get privoxy.privoxy.logdir) || _LOGDIR="/var/log"
_LOGFILE=$(uci -q get privoxy.privoxy.logfile) || _LOGFILE="privoxy.log"
mkdir -m0755 -p $_LOGDIR
touch $_LOGDIR/$_LOGFILE
chmod 664 $_LOGDIR/$_LOGFILE
chown privoxy:privoxy $_LOGDIR/$_LOGFILE
echo -e "logdir\t$_LOGDIR" >> $CFGTEMP
echo -e "logfile\t$_LOGFILE" >> $CFGTEMP
# temporary-directory
# privoxy needs read/write access
_TMP_DIR=$(uci -q get privoxy.privoxy.temporary_directory) # no default needed
@@ -100,7 +100,25 @@ _uci2conf() {
}
boot() {
return 0 # will be started by "iface" hotplug events
# wait a given time (default 10 seconds) before startup
# to wait for interfaces to come up / not using hotplug events during boot
_start() {
[ $1 -gt 0 ] && {
logger -p daemon.info -t "privoxy[]" "Scheduled startup in $1 seconds"
sleep $1
}
start
}
local _DELAY
_DELAY=$(uci_get "privoxy" "system" "boot_delay" "10")
_start $_DELAY &
return 0
}
shutdown() {
rm -f /tmp/privoxy.hotplug
stop
}
start() {
@@ -110,6 +128,7 @@ start() {
_uci2conf
/usr/sbin/privoxy --pidfile $PIDFILE --user privoxy.privoxy $CFGFILE
touch /tmp/privoxy.hotplug
# verify startup
_PID=$(cat $PIDFILE 2>/dev/null)
@@ -117,7 +136,7 @@ start() {
local _ERR=$?
[ $_ERR -eq 0 ] \
&& logger -p daemon.notice -t "privoxy[$_PID]" "Started successfully"\
|| logger -p daemon.warn -t "privoxy[-----]" "Failed to start"
|| logger -p daemon.warn -t "privoxy[]" "Failed to start"
return $_ERR
}
@@ -144,7 +163,7 @@ stop() {
logger -p daemon.notice -t "privoxy[$_PID]" "Shutdown successfully"
else
kill -9 $_tmp # Normally never come here
logger -p daemon.warn -t "privoxy[-----]" "Shutdown forced by KILL"
logger -p daemon.warn -t "privoxy[$_tmp]" "Shutdown forced by KILL"
fi
return 0
}