Page 1 of 1

Detecting if SABnzbd is already running

Posted: September 25th, 2008, 7:34 am
by Kal
Hi,

When you launch SABnzbd from desktop shortcut created by installer, it first tries to create SABnzbd daemon, then opens SABnzbd web page to default browser. But if you launch it again, SABnzbd daemon will already be running, and you will get an error like this one in your browser :
Welcome to SABnzbd.exe 0.4.4



    SABnzbd needs a free tcp/ip port for its internal web server.
    Port 8080 on localhost was tried , but it is not available.
    Some other software uses the port or SABnzbd is already running.

    Please restart SABnzbd with a different port number.

    Press Startkey+R and type the line (example):
        C:\Program Files\SABnzbd\SABnzbd.exe --server localhost:8081

    If you get this error message again, please try a different number.


Program did not start!
It would be nice if SABnzbd detects itself as already running, and, in this case, just opens its web page to default browser. You can merely do this using Mutex synchornization, see this page. If feature is accepted, and that no-one wants to implement it, I could try to do so. I'm an experienced developper but have no experience in Python.

Cheers and regards,
Kal

Re: Detecting if SABnzbd is already running

Posted: September 25th, 2008, 7:51 am
by switch
Hey, the problem is some people may want to run multiple copies of SABnzbd for reasons such as multiple users/different ports and this would disallow that unless maybe it was made an options.

Re: Detecting if SABnzbd is already running

Posted: September 25th, 2008, 7:54 am
by Kal
switch wrote: Hey, the problem is some people may want to run multiple copies of SABnzbd for reasons such as multiple users/different ports and this would disallow that unless maybe it was made an options.
Well, launching multiple copies of SABnzbd with desktop icon wouldn't work either. They'll have to launch it from command line, like this :

Code: Select all

C:\Program Files\SABnzbd\SABnzbd.exe --server localhost:8081
Mutex id should contain port number to allow multiple copies of SABnzbd on different port.