SMA and LLA Guide : Creating and running SMA applications : Starting and shutting down SMA server : Starting SMA server as a service (Windows)
  
Starting SMA server as a service (Windows)
solidDB® with SMA can be run as a service in Windows. The first time you want to run the SMA server as a service, you must install the service, that is, allow Windows to run the SMA server as a service. After that, you can start and stop the services with the Windows Service dialog or command prompt, or remove the services using solidDB® command-line options.
Before you begin
To be able to install and start services in some Windows environments (for example, Windows 2008 Server), you need to run the Windows command prompt with administrator rights.
1 In the Start menu, right-click Command Prompt.
2 Select Run as administrator.
3 Log in with an administrator account.
About this task
The first time you want to run the SMA server as a service, you must first install the service, and then start the service with the Windows Service dialog or command prompt.
Procedure
1 Allow (install) Windows to run the SMA server as a service.
In the solidDB® working directory, issue the following command:
solidsma -s"install,<name>,<fullexepath> -c<working directory>[,autostart]"
where
<name> is the service name
<fullexepath> is the full path for solidsma.exe
<working directory> is the full path for solidDB® working directory (where your solid.ini configuration file and license file are located)
[autostart] is an optional parameter that sets the Startup Type of the service to Automatic, that is, the SMA server runs automatically as a service when Windows is started.
Note Regardless of the [autostart] parameter, the service is not started automatically at the time of installation. For the first time, the service has to be started manually in the Windows Services dialog or command prompt. (See step 2 below.)
Example 1: The following command installs a service named SOLIDSMA (with Startup Type Manual) when the SMA server is installed into the directory C:\soliddb and the working directory is C:\soliddb.
solidsma -s"install,SOLIDSMA,C:\soliddb\bin\solidsma.exe -cC:\soliddb"
Example 2: The following command installs a service named SOLIDSMA (with Startup Type Automatic) when the SMA server is installed into the directory C:\soliddb and the working directory is C:\soliddb. The next time Windows is started, the SMA server will automatically run as a service.
solidsma -s"install,SOLIDSMA,C:\soliddb\bin\solidsma.exe -cC:\soliddb,autostart"
Tip: Alternatively, you can create the service using the Windows command-line utility sc.exe. In that case, to start the SMA server in a services mode, you must include the solidDB® -sstart command-line option in the command. For example:
sc create SOLIDSMA binPath= "c:\soliddb\bin\solidsma.exe -cC:\soliddb -sstart"
The -sstart command-line option is required to remove the GUI-based interactions between the SMA server and the user. Programs running as a Windows service cannot use the GUI operations.
2 Start the service manually in the Windows Services dialog or command prompt.
You can access the Windows Services dialog through Control Panel: Control Panel > Administrative Tools > Services.
In the command prompt, issue the following command:
sc start <name>
For example:
sc start SOLIDSMA
Results
When running as an Windows service, solidDB® with SMA will log warning and error messages to the Windows event log. These messages can be viewed from Windows by using the Event Viewer, available through Control Panel: Control Panel > Administrative Tools > Event Viewer. Messages are also logged to the solmsg.out file.
See also
Starting and shutting down SMA server