On Windows 2000/2003, Vista and NT systems as well as the non-home versions of XP, the Firebird engine runs as a service as does the Firebird Guardian. Both of these run under the local system user account. For best results and stability, you are advised to keep Firebird running as a service rather than as an application.
After installation, these two services are defined to be started and stopped automatically on server boot and shutdown. If you wish to control when the services are started and stopped, use Control Panel to change their properties to manual.
On Windows ME, 95, 98 and XP Home, the engine runs as an application as does the guardian. In this case, an icon will be seen in the system tray and you can carry out manual maintenance by right clicking on the icon.
Note: The remainder of this section assumes that you have the Firebird engine and the guardian running as services. All the engine commands are accessed via a right-click on the guardian icon in the system tray when running as an application.
On Windows, the guardian process is the file fbguard.exe and the engine itself is the file fbserver.exe.
Normally the instsvc command is used to install or remove services. It can also be used to start and stop services that already exist. When discussing the instsvc command below, it will be used only to start and stop services rather than installing and removing them.
When you start the guardian service on Windows, it will automatically bring up the database engine without you needing to physically start it too.
Provided you know the exact service name, you can use the net commands to start (and stop) the guardian and database engine. Up until Firebird 2.0, the service name was simply “FirebirdServer”. From Version 2.1 onwards, there can be many different services running. In this section, only the default services for Firebird 2.x will be discussed and these are “Firebird Guardian - DefaultInstance” and “Firebird Server - DefaultInstance”. As there are spaces in the names, double quotes are required to prevent errors.
C:\>net start "firebird guardian - defaultinstance" The Firebird Guardian - DefaultInstance service is starting. The Firebird Guardian - DefaultInstance service was started successfully.
As you can see from the above, under Firebird 2.x, the service names are a bit unwieldy. It is easier to use instsvc to start the services as you do not need to know the default service names.
C:\>instsvc start Service "Firebird Guardian - DefaultInstance" successfully started.
When you stop the guardian service on Windows, it will automatically bring down the database engine without you being required to stop it too.
As with starting the services, in order to use net stop to bring the guardian and engine down, you need to know the exact service name (for the guardian) and enclose it in quotes if there are spaces in the name.
C:\>net stop "firebird guardian - defaultinstance" The Firebird Guardian - DefaultInstance service is stopping. The Firebird Guardian - DefaultInstance service was stopped successfully.
As with starting the default services, stopping them is far easier using instsvc.
C:\>instsvc stop Service "Firebird Guardian - DefaultInstance" successfully stopped.
It is possible to query the services running on the server to check whether the Firebird services are running or not. Once again, the instsvc command is used:
C:\>instsvc q Firebird Guardian - DefaultInstance IS installed. Status : stopped Path : C:\Program Files\Firebird\Firebird_2_0\bin\fbguard.exe -s Startup : manual Run as : LocalSystem Firebird Server - DefaultInstance IS installed. Status : stopped Path : C:\Program Files\Firebird\Firebird_2_0\bin\fbserver.exe -s Startup : manual Run as : LocalSystem
It can be seen from the above, that there are two services installed on this server, but none of them are currently running. Other details are displayed such as whether or not these services are started automatically on reboot - in the example above, this is not the case - and the user account (LocalSystem) under which the services will be run, when they are started.
This command is very useful as it displays the two service names - once you have that information, you may use the net stop or net start commands to bring the database down and to restart it.