Par2 not found when using Sudo command
Posted: October 2nd, 2011, 2:44 pm
I've install sabnzbd+, unrar, and par2 using the optware pkg installer on my WD My Book Live. It all works great as long as I run sabnzbd as root. I tried using sudo to run sabnzb+ under the account usenet (that I created). But sab can't find the Par2 files. I checked my path and permissions and I don't see any issues.
This is how I start and stop sabnzbd+
When I su to the usenet account I can find and run par2 just fine. Not sure what the problem is. The par files are not writeable but that should be ok.
This is how I start and stop sabnzbd+
Code: Select all
#!/bin/sh
NAME="/etc/init.d/sabnzbd"
case "$1" in
start)
echo "Starting SABnzbd."
sudo -u usenet /opt/bin/python2.5 /opt/share/SABnzbd/SABnzbd.py -f /opt/share/SABnzbd/sabnzbd.ini -d
;;
stop)
echo "Shutting down SABnzbd. "
/usr/bin/wget -q "http://0.0.0.0:8080/sabnzbd/api?mode=shutdown&apikey=KEY_REMOVED"
;;
restart)
"$NAME" stop
"$NAME" start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
When I su to the usenet account I can find and run par2 just fine. Not sure what the problem is. The par files are not writeable but that should be ok.
Code: Select all
MyBookLive# su usenet
usenet@MyBookLive# echo $PATH
/opt/bin:/opt/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
usenet@MyBookLive# which par2
/opt/bin/par2
usenet@MyBookLive# ls -la /opt/bin/par*
-rwxr-xr-x 1 root root 219068 Nov 30 2010 /opt/bin/par2
lrwxrwxrwx 1 root root 4 Oct 2 11:35 /opt/bin/par2create -> par2
lrwxrwxrwx 1 root root 4 Oct 2 11:35 /opt/bin/par2repair -> par2
lrwxrwxrwx 1 root root 4 Oct 2 11:35 /opt/bin/par2verify -> par2
usenet@MyBookLive# ls -la /opt/lib/libpar*
lrwxrwxrwx 1 root root 16 Oct 2 11:30 /opt/lib/libpar2.so -> libpar2.so.0.0.1
lrwxrwxrwx 1 root root 16 Oct 2 11:30 /opt/lib/libpar2.so.0 -> libpar2.so.0.0.1
-rwxr-xr-x 1 root root 293328 Nov 30 2010 /opt/lib/libpar2.so.0.0.1