Difference between revisions of "Talk:Polipo"

From ArchWiki
Jump to: navigation, search
(Close old topic.)
(Did not respect editing guidelines)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== <s> Fix rc script </s> ==
+
== DNS error (last section) ==
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.
+
to fix the DNS error, there is (with systemd)  a much more elegant approach
 +
Just edit /usr/lib/systemd/system/polipo.service
  
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.
+
and include the line
  
        if [ -f /var/run/$DAEMON/$DAEMON.pid ]
+
'''Wants=network-online.target'''
        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.
+
just below the line
  
P.S. Excuse my ignorance in Wiki syntax and conduct.
+
'''After=network.target'''
  
:I've removed ck_daemon from start/stop, making rm /var/run/daemons/$DAEMON (which is the same as rm_daemon $DAEMON) unnecessary. Thanks, [[User:Dres|Dres]] 22:15, 30 January 2010 (EST)
 
:: Close rc.d script is not supported by Arch anymore. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 07:10, 2 May 2013 (UTC)
 
  
==<s> rc.d script if you install from source </s> ==
+
It is a hack, because the systemd file in the polipo package should be updated in reality, hence filed bugreport
If you install from [https://aur.archlinux.org/packages.php?ID=32630 polipo-git] then you will want an [https://wiki.archlinux.org/index.php/Writing_rc.d_scripts rc.d script] like the following:
+
[[User:Kvtb|Kvtb]] ([[User talk:Kvtb|talk]]) 12:27, 11 January 2014 (UTC)
{{hc|/etc/rc.d/polipo|2=
+
<nowiki>
+
#!/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
+
</nowiki>
+
}}
+
 
+
and the daemon arguments in its conf.d:
+
{{hc|/etc/conf.d/polipo|2=
+
<nowiki>
+
POLIPO_ARGS=' daemonise=true logFile="/var/log/polipo/polipo.log"'
+
</nowiki>
+
}}
+
: rc script is not supported anymore. Close. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 05:55, 2 May 2013 (UTC)
+

Latest revision as of 13:49, 10 November 2016

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, hence filed bugreport Kvtb (talk) 12:27, 11 January 2014 (UTC)