Difference between revisions of "Talk:Polipo"

From ArchWiki
Jump to: navigation, search
(Close old topic.)
(DNS error (last section): new section)
Line 71: Line 71:
 
}}
 
}}
 
: rc script is not supported anymore. Close. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 05:55, 2 May 2013 (UTC)
 
: rc script is not supported anymore. Close. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 05:55, 2 May 2013 (UTC)
 +
 +
== DNS error (last section) ==
 +
 +
to fix the DNS error, there is (with systemd)  a much more elegant approach
 +
Just edit /usr/lib/systemd/system/polipo.service
 +
 +
and include the line
 +
 +
'''Wants=network-online.target'''
 +
 +
just below the line
 +
 +
'''After=network.target'''
 +
 +
 +
It is a hack, because the systemd file in the polipo package should be updated in reality, but the polipo package is marked unmaintained,
 +
[[User:Kvtb|Kvtb]] ([[User talk:Kvtb|talk]]) 12:27, 11 January 2014 (UTC)

Revision as of 12:27, 11 January 2014

Fix rc script

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)
Close rc.d script is not supported by Arch anymore. -- Fengchao (talk) 07:10, 2 May 2013 (UTC)

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"'
rc script is not supported anymore. Close. -- Fengchao (talk) 05:55, 2 May 2013 (UTC)

DNS error (last section)

to fix the DNS error, there is (with systemd) a much more elegant approach Just edit /usr/lib/systemd/system/polipo.service

and include the line

Wants=network-online.target

just below the line

After=network.target


It is a hack, because the systemd file in the polipo package should be updated in reality, but the polipo package is marked unmaintained, Kvtb (talk) 12:27, 11 January 2014 (UTC)