Post-process script failing to launch

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
AutomaticCoding
Newbie
Newbie
Posts: 27
Joined: January 2nd, 2013, 5:20 am

Post-process script failing to launch

Post by AutomaticCoding »

So, like everyone else, I run Sab with Sickbeard, and, unfortunately, I have Python3 & Python2 installed. If I tell Sab to use "sabToSickBeard.py", it defaults for Python3 (Which is what I want), however, that causes syntax errors. So, I thought, "Well, that's easy to change, I just have to create a small bash script to run the python script with python2":-

Code: Select all

/usr/bin/python2 sabToSickBeard.py "$@"
However, that errors out with:-

Code: Select all

Exit(-1) Cannot run script /mnt/ssd/PostProcessing/sabToSickBeard.sh (More)
SABnzbd is running as a specific user for the daemon, 'sabnzbd', and, I can manually execute the bash script fine as that user:-

Code: Select all

[sabnzbd@ServerUK PostProcessing]$ /mnt/ssd/PostProcessing/sabToSickBeard.sh
No folder supplied - is this being called from SABnzbd?
So, I know I could convert the whole post process script to python3, or, change my default python application from python3 to python2, but, both of those are a pain. Can someone tell me why my bash script fails to run in SABnzbd, and, not with bash?

Thanks,
Automatic.

P.S. Because I know someone will ask:-
File permissions:-

Code: Select all

[sabnzbd@ServerUK PostProcessing]$ ls -lsa
total 28
4 drwxr-x--- 2 sabnzbd daemons 4096 Nov 24 11:01 .
4 drwxr-xr-x 7 root    root    4096 Nov 24 09:17 ..
4 -rwxr----- 1 sabnzbd daemons  105 Nov 24 09:18 autoProcessTV.cfg
4 -rwxr----- 1 sabnzbd daemons 3134 Nov 20 21:23 autoProcessTV.py
4 -rwxr----- 1 sabnzbd daemons 2825 Nov 24 09:47 autoProcessTV.pyc
4 -rwxr----- 1 sabnzbd daemons 1049 Nov 24 11:01 sabToSickBeard.py
4 -rwxr----- 1 sabnzbd daemons   40 Nov 24 10:52 sabToSickBeard.sh
Process list:-

Code: Select all

sabnzbd   3967  9.4  0.8 2979184 67516 ?       Sl   10:02   5:54 python2 /mnt/ssd/SABnzbd/SABnzbd.py -d --config-file /mnt/ssd/SABnzbd/SABnzbd.ini
EDIT:- Uh-oh, I may be stupid, just realized I was using a relative path in the bash script for the Python file. Testing this out, hopefully I didn't just publicly post my idiocy.
EDIT2: Same issue with this script:-

Code: Select all

/usr/bin/python2 "/mnt/ssd/PostProcessing/sabToSickBeard.py" "$@"
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: Post-process script failing to launch

Post by sander »

A typical .py script starts with the director which python to use, like:

#!/usr/bin/python -OO

So ... I would change that first line of the python script to the python version you want to use.

HTH
AutomaticCoding
Newbie
Newbie
Posts: 27
Joined: January 2nd, 2013, 5:20 am

Re: Post-process script failing to launch

Post by AutomaticCoding »

sander wrote:A typical .py script starts with the director which python to use, like:

#!/usr/bin/python -OO

So ... I would change that first line of the python script to the python version you want to use.

HTH
Yeah, changing the shebang fixed it, surprised I didn't think of that.

Thanks, works fine now.
Post Reply