Package: polipo
Version: 1.0.4-1
Severity: wishlist
Tags: patch
Please add support for on-disk cache purge, preferably with the init-script
and maybe you want to add that to the cron-job as well.
A possible solution is attched.
Yours Martin
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.30-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages polipo depends on:
ii libc6 2.9-25 GNU C Library: Shared libraries
polipo recommends no packages.
polipo suggests no packages.
-- no debconf information
--- /etc/init.d/polipo 2008-01-14 13:41:10.000000000 +0100
+++ polipo 2009-11-16 19:31:13.000000000 +0100
@@ -18,6 +18,8 @@
PPCTL=/usr/lib/polipo/polipo-control
test -x $PPCTL || exit 0
+PIDFILE=/var/run/polipo/polipo.pid
+
NAME=polipo
DESC=polipo
@@ -68,10 +70,25 @@
$PPCTL start
echo "$NAME."
;;
+ purge-cache)
+ #
+ # Purging the on-disk cache
+ echo -n "Write-out in-memory cache to disk..."
+ if [ -f "$PIDFILE" ] ; then
+ kill -USR1 $(cat "$PIDFILE")
+ sleep 1
+ echo " done."
+ /usr/bin/polipo -x
+ kill -USR2 $(cat "$PIDFILE")
+ # echo -n " done"
+ else
+ echo -n "$DESC seems to not be running."
+ fi
+ ;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
- echo "Usage: $N {start|stop|restart|force-reload}" >&2
+ echo "Usage: $N {start|stop|restart|force-reload|purge-cache}|" >&2
exit 1
;;
esac