Detecting if SABnzbd is already running

Want something added? Ask for it here.
Post Reply
Kal
Newbie
Newbie
Posts: 3
Joined: September 25th, 2008, 7:28 am

Detecting if SABnzbd is already running

Post 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
User avatar
switch
Moderator
Moderator
Posts: 1380
Joined: January 17th, 2008, 3:55 pm
Location: UK

Re: Detecting if SABnzbd is already running

Post 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.
Kal
Newbie
Newbie
Posts: 3
Joined: September 25th, 2008, 7:28 am

Re: Detecting if SABnzbd is already running

Post 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.
Post Reply