Page 2 of 2

Re: CRC Errors

Posted: July 24th, 2011, 3:25 am
by shypike
sl1000 wrote:is that the equivalent to kill -9?
Somebody or something disabling the QPKG and SAB taking more then 5 seconds to gracefully shutdown.
"kill -9" is instant termination.
Signal 15 is more like Control-C from a terminal.
The signal gets sent to SABnzbd, which handles it.
However SABnzbd exit can take a lot of time because it starts dumping all
cached articles to disk. With a large cache this may take more than 5 seconds.
I must look into that and see whether the exit can be staged such that the chance
of queue corruption is minimized. Of course the cached articles have less priority than an healthy queue.

Re: CRC Errors

Posted: July 24th, 2011, 4:45 am
by sl1000
What would be the proper way to stop the service? I can change my scripts :)

Re: CRC Errors

Posted: July 24th, 2011, 4:52 am
by shypike
After sending the signal, you would need to keep checking
until the process is no longer active.
So that would mean examining the "ps" output.
Does the OS have a /proc folder where each process has an entry?
Also, SABnzbd has the --pid <path> commandline option.
When used, it will write a "pid" file to the specified location and remove it just before it exits.

Re: CRC Errors

Posted: July 24th, 2011, 5:02 am
by sl1000
Yes, it has a /proc folder. It's like a normal linx distro, But qnap heavely changed busybox, and crippled most normal functions in ps, top, etc.
Checking for the pid existance would be nice, i'll look into that :)

Re: CRC Errors

Posted: July 24th, 2011, 9:02 am
by sl1000
shypike, can i also force sab to use a certain filename for the pid file? or is sabnzbd-<portnr>.pid the only fixed option?

Re: CRC Errors

Posted: July 24th, 2011, 9:14 am
by shypike
The name is fixed, but predictable.
Also because it supports multiple instances (with different ports).
So if you force the port number, you know the name.
Otherwise it's just a question of using a wild-card.