Product Documentation

Installing FairCom Products

Previous Topic

Next Topic

Starting

To start the FairCom Server on any platform:

  1. Change into the server folder
  2. Run the product executable:

    faircom.exe (or faircom on Unix/Linux)

Starting the FairCom Server on Linux, Raspbian, Android IoT, and Unix

The FairCom Server operates as a typical program on all supported Unix/Linux platforms. In these environments, FairCom recommends Administrators run the FairCom Server in the background to decrease the chance of unwittingly terminating it. For example:

# faircom &

The “no hang up” option may also be used to keep the FairCom Server from being terminated if the user starting the FairCom Server logs off the system. For example:

# nohup faircom &

Starting the FairCom Server as a daemon

On Unix/Linux systems, a script can be used to start and stop the FairCom Server. The script can be used to integrate the FairCom Server as a startup service in systems where SystemD is used to manage the startup service.

If the script is placed in the correct directory (typically /lib/systemd/system), the systemctl system tool can be used to manage the FairCom Server as system service. For example, to enable the FairCom Server service at startup, use the following command:

systemctl enable ctree.service

Because Unix/Linux packages of the FairCom Server are distributed as .tar.gz archives, we are not able to control where the files will be extracted, so the sample script shown below may need to be edited to match the paths used on your system.

The systemd tool must launch the service as root. A User= keyword may be used to start the service as the specified user. In the sample script shown below, uncomment #User=myuser and change myuser to the desired user name if you want to start the service as a different user.

The ctstop -auto command works ONLY if the default credentials are set. If you have changed these credentials, you would need to modify the script to use an authorization file with the ctstop command. Create the authorization file with the ctcmdset utility and add ‑1 filename to the ctstop command (in the line that begins ExecStop) in the script below. Note: Avoid including a password directly in the script as this practice is against security policy in most production environments.

The sample script below, called ctree.service, demonstrates how to implement such a script:

[Unit]

Description=ctree database

After=multi-user.target network.target


[Service]

#Uncomment the next line if you want to start the service as a different use than "root"

#User=myuser

Environment=LD_LIBRARY_PATH=/opt/FairCom/linux.v2.6.x86.32bit/bin/ace/sql

WorkingDirectory=/opt/FairCom/linux.v2.6.x86.32bit/bin/ace/sql

ExecStart=/opt/FairCom/linux.v2.6.x86.32bit/bin/ace/sql/ctreesql

ExecStop=/opt/FairCom/linux.v2.6.x86.32bit/tools/cmdline/admin/client/ctstop -auto

Restart=on-abort


[Install]

WantedBy=multi-user.target

Script to Start and Stop the Server

On Unix/Linux systems, a script can be used to start and stop the FairCom Server. The script can be used to integrate the FairCom Server as a startup service in systems where SystemD is used to manage the startup service. Some of the most recent Linux distributions using SystemD include RedHat 7, CentOS 7, Fedora, and Raspbian.

If the script is placed in the correct directory (e.g., /lib/systemd/system on CentOS 7), the systemctl system tool can be used to manage FairCom as system service. For example, to enable the ctree.service at startup, use the following command:

systemctl enable ctree.service

Because the Unix/Linux packages are distributed as .tar.gz archives, we are not able to control where the files will be extracted, so the sample script shown below may need to be edited to match the paths used on your system.

The systemd tool must launch the service as root. A User= keyword may be used to start the service as the specified user. In the sample script shown below, uncomment #User=myuser line and change myuser to the desired user name if you want to start the service as a different user.

The ctstop -auto command works ONLY if the default credentials are set. If you have changed these credentials, you would need to use the ctstop syntax to include the user ID and password in the script. Note: Including a password in the script is against security policy in most production environments.

The sample script shown below, called ctree.service, is an example of how to implement such a script:

[Unit]

Description=ctree database

After=multi-user.target network.target

[Service]

#Uncomment the next line if you want to start the service as a different use than "root"

#User=myuser

Environment=LD_LIBRARY_PATH=/opt/FairCom/linux.v2.6.x86.32bit/bin/ace/sql

WorkingDirectory=/opt/FairCom/linux.v2.6.x86.32bit/bin/ace/sql

ExecStart=/opt/FairCom/linux.v2.6.x86.32bit/bin/ace/sql/ctreesql

ExecStop=/opt/FairCom/linux.v2.6.x86.32bit/tools/cmdline/admin/client/ctstop -auto

Restart=on-abort

[Install]

WantedBy=multi-user.target

The kill Command

An alternative way to stop the FairCom Server is with the kill command. This command can be used in scripts if you include COMPATIBILITY TERMINATE_ON_SIGNAL in ctsrvr.cfg.

Starting the FairCom Server on Windows

On Windows, the FairCom Server opens and runs the Control Window. The name of your FairCom Server appears at the top of this window; "FAIRCOMS..." is shown below:

If you close this window, the FairCom Server continues to run and the window is minimized to the task bar. This window provides menu options to shut down the FairCom Server, open the Message Monitor window, and open the Function Monitor window.

Message Monitor Window

The message window shows console messages. The startup messages tell you information such as TCP/IP ports for applications to communicate with the FairCom Server, license information such as the maximum allowed connections, and a notice if the server is in DEMO mode, which shuts down automatically every 3 hours.


Function Monitor Window

The function monitor (View > Function Monitor Window) is for basic troubleshooting. It displays a message each time an application calls a FairCom function. Note: When it is open, it significantly slows down the performance of the FairCom Server so it can show you each function an application calls.

Starting the FairCom Server from the Windows Command-Line

If you want to run the FairCom Server in the console tray without displaying the Control Window, disable the TOOL_TRAY keyword in ctsrvr.cfg as follows:

;CONSOLE TOOL_TRAY

Then run the FairCom Server from the command-line as follows:

C:\server> faircom ^&

The ^& command-line option runs c-tree in the tool tray without displaying the user interface.

Note: It is a best practice for production deployments on Windows to run the FairCom Server as a Windows Service. This ensures Windows keeps it running, and it allows administrators to easily manage the service remotely.

Starting the FairCom Server as a Windows Service

Start the FairCom Server service using either the Microsoft sc.exe command or the Windows Services Control Panel applet.

To start the service using the Windows Services Control Panel applet:

  1. Open the Control Panel.
  2. Select the Services applet.
  3. From the list of the installed services, select the name for the FairCom service.
  4. Click Start to start the service.

Note: Installing the FairCom Server using the Windows Installer automatically makes it available to run as a Windows Service. If you installed by unzipping into a folder, then you need to manually configure the FairCom Server to run as a service. See the section below, “Configuring as a Windows Service.”

Running Multiple FairCom Servers on One Computer

You can run multiple instances of the FairCom Server on the same computer as long as they do not share anything: files, server names, licenses, and ports.

  1. Each instance must be individually licensed with its own license file (See Licensing below).
  2. Each instance must be installed in a separate folder so that each has a unique set of server, configuration, and data files (see Installing above).
  3. Each instance must have a unique server name.
  4. Each instance must have unique communications ports.

Important! Separate instances of the FairCom Server cannot share anything: files, server names, licenses, and ports.

Changing the Name of the FairCom Server

The default name for the server is FAIRCOMS. The name is defined in ctsrvr.cfg using the following keyword phrase:

SERVER_NAME FAIRCOMS

Changing the Name of the Service in Windows

When running multiple FairCom servers as Windows Services, you must also configure each service to have a unique Service Name.

Changing All Ports

See Configuring Ports below to change all ports for each instance of the FairCom Server (or at least all the ports that you are using).

Note: Port conflicts are the most common problem with running multiple instances of c-tree on the same computer. The FairCom Server has many ports that are changed in several different configuration files. Be sure to change all ports (or at least all ports that you are using). Also be sure to use ports that are not in use; otherwise, port conflicts can prevent you from being able to communicate with the FairCom Server.

TOCIndex