Difference between revisions of "Talk:Polipo"

From ArchWiki
Jump to: navigation, search
(rc.d script if you install from source)
(Close old topic.)
Line 1: Line 1:
 +
== <s> Fix rc script </s> ==
 
Hi all,
 
Hi all,
  
Line 19: Line 20:
  
 
: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)
 
: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> ==
 
==<s> rc.d script if you install from source </s> ==

Revision as of 07:10, 2 May 2013

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)