Page 1 of 2

PostProcessing doesnt work?

Posted: February 12th, 2008, 6:20 pm
by Usenet
Hi!

IM having trouble getting the post processing script to run. I've made a RoboCopy.cmd file doing some string manipulation and moving files from the SABnzb computer to my NAS. Running the script manually works flawlessly. Looking in the logs it seems as it should work, or?

Code: Select all

2008-02-12 22:00:07,405::INFO::[assembler] Running external script C:\Program\SABnzbd\RobocopyScript.cmd C:\Program\SABnzbd\download\complete\NwsgroupPost NwsgroupPost.nzb
2008-02-12 22:00:07,405::INFO::[newsunpack] Spawning external command ['C:\\Program\\SABnzbd\\RobocopyScript.cmd', 'C:\\Program\\SABnzbd\\download\\complete\\NwsgroupPost', 'NwsgroupPost.nzb', 'NwsgroupPost', '']
2008-02-12 22:00:07,500::INFO::[assembler] Cleaning up NwsgroupPost.nzb
Could the double \\ be right?

-cheers

[rascalli edit ;  moved to right forum]

Re: PostProcessing doesnt work?

Posted: February 13th, 2008, 2:56 am
by shypike
The double backslashes are OK, that's just a Python habit of displaying strings.
Be aware that all parameters passed to your script have double quotes around them.

What I do find strange is that your stuff is installed in "C:\Program\SABnzbd".
Normally it is installed in "C:\Program Files\SABnzbnd".

Is "C:\Program\SABnzbd" the correct location?
If not, how did you specify the location of your script to SABnzbd?

Re: PostProcessing doesnt work?

Posted: February 13th, 2008, 9:43 am
by Usenet
I'm running SAB as a service and the path is correct (all languages doesn't use "Program Files" ;) ).

the double quotes, they could be the reason... unless it's some user right thing. THANKS for the tip!


A bit OT, but why specify dependency to TCP/IP when configuring as a service (from the wiki)?
The service stops working if i log in and the out from the system and Im suspecting the TCP/IP dependency...

Re: PostProcessing doesnt work?

Posted: February 13th, 2008, 10:13 am
by shypike
As SABnzbd uses the TCP/IP stack, it is dependent on it.
Otherwise Windows may start SABnzbd before the TCP/IP stack is up and running.

When it stops on logout, there is definitively something wrong in your service setup.

I used it a service quite often, works ok.
Only when you stop SABnznd from the web interface, you have to stop and start the service again.

Re: PostProcessing doesnt work?

Posted: February 13th, 2008, 10:49 am
by Usenet
Thanks for the help, time to go home and test a bit more then ;)

Re: PostProcessing doesnt work?

Posted: February 13th, 2008, 2:57 pm
by Usenet
Still cant get the service to survive log off.
From information of srvany.exe:
Programming Considerations:

For  WIN32  graphical  applications:  when  the currently logged-in user is
logging-off,  all  WIN32  top-level  windows receive WM_QUERYENDSESSION and
WM_ENDSESSION  messages.  Some  WIN32 applications choose to terminate upon
receipt  of  such  messages. In order for your WIN32 application to survive
logoff,  it  must  not do that: instead, your windows procedure should call
the default windows procedure on these messages.

For  WIN32  Console  (i.e. character-mode) applications: when the currently
logged-in  user  is  logging-off,  all  Console  applications  receive  a
CTRL_LOGOFF_EVENT  event  from the Console. If your Console application has
registered  a  Console  event  handler (via SetConsoleCtrlHandler), it must
ignore CTRL_LOGOFF_EVENT in order  to survive the logoff.
I tried all sort of tricks to avoid killing the application even tried the sabnzbc.exe -d switch (wich i dont knof if its needed)

Re: PostProcessing doesnt work?

Posted: February 13th, 2008, 3:56 pm
by shypike
I haven't used it as a service for some time. :-\

I will run some tests soon.

BTW, maybe the trick is to run it as another user. Make a special account that doesn't login normally.

Re: PostProcessing doesnt work?

Posted: February 13th, 2008, 3:59 pm
by Usenet
Great, just a note. It start as a service from fresh reboot. Continues to run after logging in but closes when logging out.

Keep up the good work!

Re: PostProcessing doesnt work?

Posted: February 13th, 2008, 4:24 pm
by shypike
I just checked.

It's totally counter-intuitive, but if you use the console version of SABnzbd, it DOES work fine.

So you should start this way:

Code: Select all

SABnzbd-console.exe -d -f <path-to-my-ini>
The problem, the "windowed" version gets and handles the exit command, the console version ignores it.

We're not going to fix this for 0.3.1, but later we will.
The work-around is good enough for now.

Re: PostProcessing doesnt work?

Posted: February 13th, 2008, 7:28 pm
by Usenet
Thanks for the help, but i cant get it to work.

Im running 3.1.0rc1 on winXP. with its own user account (admin rights). I changed the registry settings according to your tip but no... :(

Re: PostProcessing doesnt work?

Posted: February 14th, 2008, 4:19 am
by shypike
Not sure if it makes the difference, but I start SABnzbd thorugh a batch file.
So the registry points to a CMD file, and that file starts the program.

My content of the CMD file:

start d:\bin\SABnzbd\SABnzbd-console --daemon -f d:\usernet\sabnzbd.ini

This way it works fine on my Server2003 box.

Re: PostProcessing doesnt work?

Posted: February 14th, 2008, 4:29 am
by Usenet
Ok, I see.
Are you still using anysrv.exe from the 2003 resource kit as described in the wiki?

Re: PostProcessing doesnt work?

Posted: February 14th, 2008, 3:51 pm
by Usenet

Code: Select all

2008-02-14 20:40:25,015::WARNING::[sabnzbd] Signal 5 caught, saving and exiting...
is what i get in the logs every time I log out. Any idea what it might be?

Re: PostProcessing doesnt work?

Posted: February 14th, 2008, 5:02 pm
by shypike
The only time I get a Signal 5 is when I run SABnzbd.exe as a service.
Not when I use SABnzbd-console.exe

Maybe I was not clear, you're supposed to use the other exe file, there are two starting with 0.3.1rc1.

And yes, I do use the method described in the Wiki.

Re: PostProcessing doesnt work?

Posted: February 14th, 2008, 5:13 pm
by Usenet
You are very clear, and Im thankfull for that.
Im using the SABnzbd-console.exe file.. a strange thing though, both have the exact same size 79360bytes... could this be right?