You are not logged in.

#1 2008-11-14 19:13:20

Tad2much
Member
Registered: 2008-10-27
Posts: 6

tinyproxy from AUR

OK, perhaps I haven't quite gotten the AUR PKGBUILD system down yet, but I'm having a little trouble figuring out the tinyproxy package.  I've run this proxy on other distros and it always has had an entry in init.d or rc.d that I can run it as a daemon from.  For some reason the PKGBUILD package that I built does not have this and I'm wondering if I did something wrong or if I'm simply missing something here?

What I did:

-Downloaded tarball for tinyproxy 1.6.4-1
-Edited PKGBUILD for x86_64 architecture
-makepkg
-pacman -U <package>

After that everything appeared to work ok, I can see it installed, all the conf files are there and everything, but there is no script to run in rc.d and so I can't quite figure out how to get this going.  I realize there are other packages in the Arch repos like privoxy, but since I'm just doing some basic proxying I like how small and simple tinyproxy is.  Anybody else run into this problem and figure out how to resolve this?  Thanks in advance for any help.

Offline

#2 2008-11-14 21:41:41

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: tinyproxy from AUR

The package does not ship with an rc script. However, it's very easy to make one based on /usr/share/pacman/rc-script.proto:

#!/bin/bash

daemon_name=tinyproxy
config=/etc/tinyproxy/tinyproxy.conf

. /etc/rc.conf
. /etc/rc.d/functions

get_pid() {
    pidof -o %PPID $daemon_name
}

case "$1" in
  start)
    stat_busy "Starting $daemon_name daemon"

    PID=$(get_pid)
    if [ -z "$PID" ]; then
      [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid
      # RUN
      /usr/sbin/tinyproxy -c $config
      #
      if [ $? -gt 0 ]; then
        stat_fail
        exit 1
      else
        echo $(get_pid) > /var/run/$daemon_name.pid
        add_daemon $daemon_name
        stat_done
      fi
    else
      stat_fail
      exit 1
    fi
    ;;

  stop)
    stat_busy "Stopping $daemon_name daemon"
    PID=$(get_pid)
    # KILL
    [ ! -z "$PID" ] && kill $PID &> /dev/null
    #
    if [ $? -gt 0 ]; then
      stat_fail
      exit 1
    else
      rm -f /var/run/$daemon_name.pid &> /dev/null
      rm_daemon $daemon_name
      stat_done
    fi
    ;;

  restart)
    $0 stop
    sleep 3
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"  
esac
exit 0

Offline

#3 2008-11-14 22:14:13

Tad2much
Member
Registered: 2008-10-27
Posts: 6

Re: tinyproxy from AUR

Oh wow thanks!  That's very useful!

However, when I start the script it says:

:: Starting tinyproxy daemon                                                                                              [DONE]


But then it does not show up in my process list.  Perhaps it wasn't compiled with daemon support.  Not sure, but I will keep looking, just wanted to tell you thanks!

Offline

#4 2008-11-15 10:42:31

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: tinyproxy from AUR

I had that issue too. You just need to change "Group nogroup" to "Group nobody" in /etc/tinyproxy/tinyproxy.conf.

Offline

#5 2008-11-15 14:16:17

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: tinyproxy from AUR

I'm not using tinyproxy but this thread is interesting: are you saying that when you install the package, it places an initscript in /etc/rc.d, but the script is not in the package? That's weird..

Can you do this: grep -R 'rc\.d' <directory where you extracted package contents> ?


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#6 2008-11-17 11:18:46

zukka
Member
From: Bologna Italy
Registered: 2006-06-27
Posts: 26

Re: tinyproxy from AUR

ok, I fixed the package (I hope tongue )
now there's a rc script posted by foutrelis and a fix for the default group in the config file.

Offline

#7 2008-11-17 13:13:08

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: tinyproxy from AUR

Works great, zukka. tongue

For future reference, you can edit files in place by passing the -i switch to sed:

sed -i 's/Group nogroup/Group nobody/' $pkgdir/etc/tinyproxy/tinyproxy.conf

Offline

#8 2008-11-17 13:20:29

zukka
Member
From: Bologna Italy
Registered: 2006-06-27
Posts: 26

Re: tinyproxy from AUR

foutrelis wrote:

For future reference, you can edit files in place by passing the -i switch to sed:

I've never used sed too much, thank you for the advice I'll use -i in the next pkgrelease wink

Offline

#9 2008-11-17 14:48:55

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: tinyproxy from AUR

Learn to use sed, it's a lifesaver tongue Interesting package, by the way!


.:[My Blog] || [My GitHub]:.

Offline

#10 2008-11-17 15:17:54

zukka
Member
From: Bologna Italy
Registered: 2006-06-27
Posts: 26

Re: tinyproxy from AUR

Ghost1227 wrote:

Learn to use sed, it's a lifesaver tongue Interesting package, by the way!

I know smile , but I usually tend to use python when things get tricky...
I prefer a simple script than 3 Kbytes of piped command lines ( even if sometimes I'm fashinated by that ).
But I must admit that in the pkgbuild python would have been a bit overkill big_smile
Anyway, I promise I will learn sed more wink

Offline

#11 2008-11-17 16:30:09

Tad2much
Member
Registered: 2008-10-27
Posts: 6

Re: tinyproxy from AUR

Changing the group did indeed do the trick.  Thanks for all the help!  New to Arch, but so far it seems like a great distribution with a great community behind it!  Loving it so far.

Offline

Board footer

Powered by FluxBB