Official Documentation...

SourceForge.net Logo Support This Project

[ Table of Contents ]


BNBT System Service Tutorial

If you are already comfortable working with system services, feel free to skip to the section on using The Custom NT Service Name Feature.

If you are running one of the following versions of Windows, you have the option of running your BNBT or Trinity Edition
tracker as an NT (System) Service instead of running it in a command interpreter window (command console).

  • Windows NT

  • Windows 2000

  • Windows XP

  • Windows Server 2003

Note: Your tracker should never be running as a system service AND in a command console at the same time.




Pros and Cons

Here are some advantages (pros) to running your tracker as a system service:

  1. System Services start automatically when your computer boots.
    In most cases, logging into Windows isn't even necessary for your tracker to start.

  2. System Services can be configured to auto-restart if the service crashes.

  3. System Services run completely in the background, and in most cases use less resources.
    The also means that the application will not take up room on your Windows Taskbar.

  4. It is not necessary for you to manually shutdown your tracker when restarting your computer.

Here are some disadvantages (cons) to running your tracker as a system service:

  1. You will have no immediate visible proof that your tracker is running.

  2. Error messages will only be sent to the tracker's log (if enabled) as opposed to being displayed on your screen.

[ Back to the Top ]




Getting Started

Note: It is highly recommended that you begin by running your tracker in command console mode, until you have sufficiently configured all settings and aspects of your tracker. In command console mode, it will be much easier to shutdown and restart the tracker, which is required each time you modify the configuration settings.

Running the tracker in a command console will also write the default values for any required and missing configuration keys to your tracker's configuration file, so that errors are not encountered when running your tracker as a system service.

When you have finished setting up your tracker, we can then install and begin running it as a system service. Installing a system service is very different from installing an application. It is simply a process, by which you "add" a program to your computer's System Services Console, so that Windows recognizes it as a system service.

First, let us open the Microsoft Management Console (MMC) for System Services. This can be accomplished in many ways, however the following is the simplest:

  1. Click the Start button

  2. Click Run...

  3. Type services.msc and press ↵  Enter
Keyboard Shortcut: Pressing the Windows Key + R will open the Run... dialog.

You will be presented with a window that doesn't look dissimilar from this:

You should only be concerned with the first, third and fourth columns.

You may have to resize the window or click the Standard tab at the bottom to see the fourth column.

  1. Name — displays the service name for the application
    Note: this value must be unique, in that no two services can have the same service name

  2. Status — if the service is running, this will read Started; if the service is not running, this value will be blank.

  3. Startup Type

    • Automatic — will be started with Windows

    • Manual — will NOT be started with Windows, but remains installed as a system service; must be started manually.

[ Back to the Top ]




Step 1 — Installation

We will now install the tracker executable as a system service.

  1. Open a Command Prompt... (Open a Run dialog, type cmd and press ↵  Enter

  2. Change to the tracker's directory. If you installed BNBT as part of BNBT EasyTracker
    and you accepted the default install location, this will be C:\Program Files\BNBT EasyTracker.

    The path must be surrounded by quotation marks because spaces exist in the name.

    CD "C:\Program Files\BNBT EasyTracker\"   ↵

  3. Type the following command to install BNBT as a system service:

    bnbt -i   ↵

  4. The service is now installed.

    The installation can be verified by going to the System Services MMC. If it is still open, you will need to press F5 to refresh the list of services.

    [ Back to the Top ]




    Step 2 — Starting the (Tracker) Service

    The service can be started one of two ways:

    Method 1 — Using the System Service MMC

    1. Select the BNBT Service

    2. Click the Play  button

    A dialog will popup for a quick moment, saying that Windows is attempting to start the service:

    The Status for the service should now be Started:



    Method 2 — Using the Command Prompt

    1. Open a command prompt and switch to the tracker directory as you did when you installed the service.

    2. Type the following command to start the service:

      bnbt -start   ↵

    Alternatively, you can use the Windows command NET START to start the service, which doesn't require being in the tracker's directory:

    [ Back to the Top ]




    Stopping the Service (Shutting Down the Tracker)

    If you wish to shutdown your tracker, there are numerous ways to stop the tracker service.

    1. Using the MMC — Select the Service and press the Stop  button.

    2. Using the Command Prompt — Switch to the tracker's directory and type the following command:

      bnbt -stop   &crarr

    3. Using the Command Prompt — type the following Windows command:

      NET STOP "BNBT Service"   ↵

    4. Using the button — which can be found on the Admin page of the tracker's website,
      which of course, could be accessed from a remote location.

    [ Back to the Top ]




    Uninstalling the Service

    If you no longer want to run your tracker as a system service, there are two ways this can be accomplished.

    1. You could uninstall the service with the following commands:

      CD "C:\Program Files\BNBT EasyTracker\"   ↵
      bnbt -u   ↵

      Important Note: You must stop the service before uninstalling it.

      If you wanted to run the tracker as a service again, it would require that you reinstall the service.

    2. You could switch the Startup Type to Manual. This would leave the service installed, but it won't automatically start the tracker in service mode when the computer is booted.

      To switch the Startup Type, right-click on the service in the MMC and click Properties. Change Startup type to Manual and click OK.

    [ Back to the Top ]






    Using the Custom NT Service Name Feature
    — a feature of The Trinity Edition of BNBT

    The following feature is intended for individuals who are either already running (or plan on running) 2 BNBT trackers (both as system services) from the same PC. If you do not plan on running more than 1 tracker, it is recommended that you do not modify the trinity_nt_service_name value in your configuration file, as this can cause future errors to occur.

    As discussed earlier in this tutorial, no two system services can have the same name. By default, BNBT uses the following service name when installing itself: BNBT Service. If you attempted to install a second instance of BNBT as a system service, you would receive an error, because the service names are identical.

    This is the reason that I originally created the Secondary Tracker Executable. It had a different service name hard-coded into the program.

    Enter the trinity_nt_service_name configuration key.

    Note This key's value is used by BNBT when installing, starting, stopping and uninstalling the tracker as a system service. It is therefore extremely important that this value not be changed after you install the service. If it is changed, errors can occur. It is only safe to modify this value, when BNBT is not currently installed as a system service.

    Important Note for Upgraders

    If you are already running two instances of BNBT as system services, using the (previously available) Secondary Service Tracker Executable, you should stop and uninstall both trackers from System Services. (It is not necessary for you to uninstall the actual program files).

    Download the newest version of The Trinity Edition of BNBT and overwrite both tracker executables. Open the configuration files (bnbt.cfg) for both trackers and add the new configuration string to both files.

    Tracker 1: trinity_nt_service_name = BNBT Service

    Tracker 2: trinity_nt_service_name = BNBT Service 2

    These keys can also be added using the Frontend Configuration Utility, by adding them to the Raw tab.

    You can then go about installing each executable as a system service, using the instructions found above.

    Special Note: If this value is not specified in your configuration, new versions of The Trinity Edition of BNBT will automatically add this key and its default value (BNBT Service) to your configuration when you start the executable for the first time.

    Because of this new configuration key, it is actually possible to run more than 2 trackers as system services, just as long as each of them have unique service names.


    Special Thanks to DWKnight and Varlock for helping me add this feature to The Trinity Edition of BNBT.

    [ Back to the Top ]










[ Table of Contents ]

©2004 ZionMatrix.com