Page 1 of 1

False post processing error (orig. from Beta Releases)

Posted: May 13th, 2011, 8:10 pm
by krackt
Hi shypyke is this still on your radar to look at? It was not fixed in 0.6.0 final.
http://forums.sabnzbd.org/index.php?topic=6917.0

Re: False post processing error (orig. from Beta Releases)

Posted: May 14th, 2011, 7:25 am
by shypike
I cannot reproduce it on Ubuntu.
Your solution is not entirely correct, though.
The shutdown script never returns control to SABnzbd, so SABnzbd is never terminated properly.
This may or may not cause a problem, it's undetermined.

What you should do is create a script that spawns the shutdown command
and then returns to SABnzbd.
Something like this:

#!/bin/sh
sudo shutdown -h 2 &

The & makes shutdown run as a separate process and your script will end,
giving SABnzbd the chance to close.

Re: False post processing error (orig. from Beta Releases)

Posted: May 14th, 2011, 11:44 pm
by krackt
I tested your suggestion by adding the ampersand but it still doesn't work as expected.
Here is the output of the logfile as the script is executed. As you can see sab doesn't re-commence processing until the script process ends completely.

Code: Select all

2011-05-15 13:37:24,952::INFO::[downloader:610] Thread 10@secure.us.thundernews.com:81: forcing disconnect
2011-05-15 13:37:25,054::INFO::[downloader:610] Thread 2@secure.us.thundernews.com:81: forcing disconnect
Broadcast message from root@bricktop
	(unknown) at 13:38 ...

The system is going down for halt in 1 minute!

Broadcast message from root@bricktop
	(unknown) at 13:39 ...

The system is going down for halt NOW!

2011-05-15 13:39:24,063::WARNING::[__init__:156] Signal 15 caught, saving and exiting...
2011-05-15 13:39:24,081::INFO::[nzbqueue:167] Saving queue
2011-05-15 13:39:24,082::INFO::[__init__:824] Saving data for queue9.sab in /home/xbmc/.sabnzbd/admin/queue9.sab
2011-05-15 13:39:24,083::INFO::[__init__:824] Saving data for totals9.sab in /home/xbmc/.sabnzbd/admin/totals9.sab
2011-05-15 13:39:24,085::INFO::[__init__:824] Saving data for rss_data.sab in /home/xbmc/.sabnzbd/admin/rss_data.sab
2011-05-15 13:39:24,187::INFO::[__init__:824] Saving data for bookmarks.sab in /home/xbmc/.sabnzbd/admin/bookmarks.sab
2011-05-15 13:39:24,189::INFO::[__init__:824] Saving data for watched_data.sab in /home/xbmc/.sabnzbd/admin/watched_data.sab
2011-05-15 13:39:24,191::INFO::[postproc:83] Saving postproc queue
2011-05-15 13:39:24,191::INFO::[__init__:824] Saving data for postproc1.sab in /home/xbmc/.sabnzbd/admin/postproc1.sab
2011-05-15 13:39:24,240::INFO::[__init__:843] Loading data for running.sab from /home/xbmc/.sabnzbd/admin/running.sab
Connection to bricktop closed by remote host.
Would it be possible to have the end-of-queue "On Finish" actions and scripts available to individual downloads? (Shutdown PC, Hibernate PC, Standby PC)
At present only scripts are available.
I would definitely use this more than end-of-queue actions as my queue is never empty.

Re: False post processing error (orig. from Beta Releases)

Posted: May 15th, 2011, 2:25 am
by shypike
No one has ever asked for shutdown as a post-processing script.
With a bit of clever script programming this would be possible.
The script should send a shutdown api call to SABnzbd and shutdown the system.

BTW: the & may not be the right solution.
I'm no Unix expert and I will move this topic to the Ubuntu/Debian section.

Re: False post processing error (orig. from Beta Releases)

Posted: May 15th, 2011, 4:02 am
by jcfp
Try 'sudo -b' instead.

Re: False post processing error (orig. from Beta Releases)

Posted: May 15th, 2011, 11:14 pm
by krackt
Backgrounding the script job doesn't help. The problem is that sab doesn't commence its cleanup routines until after the script has completed executing.

I've even tried shutting down sab first using the api and then running the shutdown pc script but sab still doesn't run it's cleanup until after the shutdown has commenced. How can that happen when sab is already shutdown?

Tailing the sab logfile shows it still receiving data even when sab has shutdown until the pc shuts down.