Powershell not exiting when called by SAB

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
Mills
Newbie
Newbie
Posts: 11
Joined: August 19th, 2009, 7:02 pm

Powershell not exiting when called by SAB

Post by Mills »

I use some postprocessing powershell scripts (called by a bat file), and when they are called by SABnzbd in postprocessing they never exit. If I grab the commandline being executed with process explorer, and paste it into cmd, it runs perfectly fine.

The little output log added (thank you devs!) when I kill the script just shows up to the powershell execution and nothing afterward. Even if I modify the powershell script to just run dir, it will still hang. The strange thing is this worked just fine on my Windows 7 computer. Not sure how to debug this. Would appreciate any help.

Version: 0.5.0
OS: Windows Server 2008 R2 Standard

EDIT: This seems to be a common problem with powershell in general when being called by other programs. /EDIT
EDIT2: Screw Powershell I just rewrote everything in C#. /EDIT2

Thanks,

Mills
Last edited by Mills on March 7th, 2010, 10:14 am, edited 1 time in total.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Powershell not exiting when called by SAB

Post by shypike »

Yeah, somehow MS had to screw up.
You didn't think they'd make a really usable scripting language, now did you?  ;D
mikeyj
Newbie
Newbie
Posts: 24
Joined: February 20th, 2010, 12:17 am

Re: Powershell not exiting when called by SAB

Post by mikeyj »

I'm having a similar problem with Robocopy.  The first time this code runs it's fine but it never exits and any item in the queue that follows will not process.

Code: Select all

robocopy M:\!Processing\_tv\ M:\!Processing\_tvfinished\ /E /XD _* /MOV /MON:1 /MOT:1
Any thoughts?
Thx,
Mike
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Powershell not exiting when called by SAB

Post by shypike »

Of course it doesn't exit.
The /MON and /MOT parameters will make it run forever.
You cannot use those in a script.
See:
http://www.stevelu.com/TechnicalArticle ... /1206.aspx
Post Reply