You are not logged in.
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
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
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
I had that issue too. You just need to change "Group nogroup" to "Group nobody" in /etc/tinyproxy/tinyproxy.conf.
Offline
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
ok, I fixed the package (I hope )
now there's a rc script posted by foutrelis and a fix for the default group in the config file.
Offline
Works great, zukka.
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
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
Offline
Learn to use sed, it's a lifesaver Interesting package, by the way!
I know , 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
Anyway, I promise I will learn sed more
Offline
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