Talk:Polipo

From ArchWiki
Revision as of 07:15, 28 April 2013 by Kynikos.bot (Talk | contribs) (use https for links to archlinux.org)

Jump to: navigation, search

Hi all,

I am new here so I don't want to go and change stuff out of the blue and thought I'd post here first.

I am running the the polipo-git version from AUR and Polipo crashes once in a while. And when that happens, the daemon leaves residual files that prevent restarting it normally using the rc.d script. So, in my script, I have added a few commands to the beginning of the start section of the script to remove these files.

       if [ -f /var/run/$DAEMON/$DAEMON.pid ]
       then
               rm /var/run/$DAEMON/$DAEMON.pid
       fi
       if [ -f /var/run/daemons/$DAEMON ]
       then
               rm /var/run/daemons/$DAEMON
       fi

If you see it fit to add these lines to the script in the wiki please do so.

P.S. Excuse my ignorance in Wiki syntax and conduct.

I've removed ck_daemon from start/stop, making rm /var/run/daemons/$DAEMON (which is the same as rm_daemon $DAEMON) unnecessary. Thanks, Dres 22:15, 30 January 2010 (EST)

rc.d script if you install from source

If you install from polipo-git then you will want an rc.d script like the following:

/etc/rc.d/polipo
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
POLIPO_ARGS=
[ -f /etc/conf.d/polipo ] && . /etc/conf.d/polipo
PID=`pidof -o %PPID /usr/local/bin/polipo`
case "$1" in
 start)
   stat_busy "Starting Polipo"
   [ -z "$PID" ] && sudo -u nobody /usr/local/bin/polipo ${POLIPO_ARGS}
   if [ $? -gt 0 ]; then
     stat_fail
   else
     add_daemon polipo
     stat_done
   fi
   ;;
 stop)
   stat_busy "Stopping Polipo"
   [ ! -z "$PID" ]  && kill $PID &> /dev/null
   if [ $? -gt 0 ]; then
     stat_fail
   else
     rm_daemon polipo
     stat_done
   fi
   ;;
 restart)
   $0 stop
   $0 start
   ;;
 *)
   echo "usage: $0 {start|stop|restart}"  
esac
exit 0

and the daemon arguments in its conf.d:

/etc/conf.d/polipo
POLIPO_ARGS=' daemonise=true logFile="/var/log/polipo/polipo.log"'