diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-05-03 17:18:23 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-05-03 17:18:23 -0300 |
commit | d03a5bade3aec91c7201fd864cb60668b3435a6c (patch) | |
tree | d98815cf9209dba89e3f0ad34b48b19bb2f72585 | |
parent | e7b56cc8b6b28d44103f8a36fe56e2f913d21f8d (diff) | |
download | puppet-tor-d03a5bade3aec91c7201fd864cb60668b3435a6c.tar.gz puppet-tor-d03a5bade3aec91c7201fd864cb60668b3435a6c.tar.bz2 |
Avoiding annoying messages
-rwxr-xr-x | files/polipo.cron | 22 | ||||
-rw-r--r-- | manifests/init.pp | 10 |
2 files changed, 32 insertions, 0 deletions
diff --git a/files/polipo.cron b/files/polipo.cron new file mode 100755 index 0000000..c8d7bd0 --- /dev/null +++ b/files/polipo.cron @@ -0,0 +1,22 @@ +#!/bin/sh +set -e + +FORBIDDEN_FILE=/etc/polipo/forbidden +CONFIG_FILE=/etc/polipo/config + +if [ ! -x /usr/bin/polipo ]; then + exit 0 +fi + +if [ ! -f $FORBIDDEN_FILE ]; then + FORBIDDEN_FILE=/dev/null +fi + +PIDFILE=/var/run/polipo/polipo.pid +[ -f "$PIDFILE" ] && kill -USR1 $(cat "$PIDFILE") +# TODO: remove redirect stderr to /dev/null after the following bug is solved: +# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=580434 +su -c \ + "nice polipo -x -c $CONFIG_FILE forbiddenFile=$FORBIDDEN_FILE &> /dev/null" \ + proxy +[ -f "$PIDFILE" ] && kill -USR2 $(cat "$PIDFILE") diff --git a/manifests/init.pp b/manifests/init.pp index a6c02bb..bfd17ea 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -33,4 +33,14 @@ class tor { notify => Service["polipo"], require => File["/etc/polipo"], } + + # TODO: restore file to original state after the following bug is solved: + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=580434 + file { "/etc/cron.daily/polipo": + ensure => present, + owner => root, + group => root, + mode => 0755, + source => "puppet://$server/modules/tor/polipo.cron", + } } |