Advanced Linux Installation

FairCom repository setup script

LICENSE NOTIFICATION

FairCom software is subject to a FAIRCOM EVALUATION LICENSE AGREEMENT, which can be found here. Before continuing to set up a repository script for any FairCom Software, please review the license agreement for the particular FairCom software you are attempting to install. 

Your continued use of the FairCom software SHALL BE YOUR AFFIRMATIVE ACT OF ACCEPTANCE OF ALL THE TERMS OF THIS AGREEMENT. IF YOU DO NOT AGREE WITH ANY PROVISION OF THIS AGREEMENT, DO NOT ACCESS OR USE THE SOFTWARE IN ANY WAY. Contact FairCom if you have questions or concerns about this Agreement. 

 

Download and install through FairCom's repository:

Download the script:

curl -LsSO https://repo.faircom.com/faircom_repo_setup.sh

Set the script to be executable:

chmod +x faircom_repo_setup.sh

Run the script:

sudo ./faircom_repo_setup.sh

Example of running previous script

$ curl -LsSO https://repo.faircom.com/faircom_repo_setup.sh
$ chmod +x faircom_repo_setup.sh
$ sudo ./faircom_repo_setup.sh 
Detected glibc 2.41 -> el10
Writing /etc/yum.repos.d/faircom.repo (el7/x86_64)...
Updating and loading repositories:
Fedora 42 - x86_64 - Updates                                                                                                                                               100% |   9.0 KiB/s |   3.4 KiB |  00m00s
FairCom Packages                                                                                                                                                           100% |   4.2 KiB/s |   3.5 KiB |  00m01s
Repositories loaded.
Metadata cache created.
Done. Install FairCom packages with: yum/dnf install <package>  (or zypper install <package>)
 
 

 

One-liner

You can also configure the package manager to install FairCom software with a one-liner

curl -fsSL https://repo.faircom.com/faircom_repo_setup.sh | sudo bash

Example of running previous script

Notice below that a faircom.repo file was installed into /etc/yum.repos.d/ directory

$ ls /etc/yum.repos.d/
fedora-cisco-openh264.repo  fedora.repo  fedora-updates.repo  fedora-updates-testing.repo
$ curl -fsSL https://repo.faircom.com/faircom_repo_setup.sh | sudo bash
Detected glibc 2.41 -> el10
Writing /etc/yum.repos.d/faircom.repo (el7/x86_64)...
Updating and loading repositories:
Fedora 42 - x86_64 - Updates                                                                                                                                               100% |   7.0 KiB/s |   3.4 KiB |  00m00s
FairCom Packages                                                                                                                                                           100% |   4.3 KiB/s |   3.5 KiB |  00m01s
Repositories loaded.
Metadata cache created.
Done. Install FairCom packages with: yum/dnf install <package>  (or zypper install <package>)
$ ls /etc/yum.repos.d/
faircom.repo  fedora-cisco-openh264.repo  fedora.repo  fedora-updates.repo  fedora-updates-testing.repo
$ cat /etc/yum.repos.d/faircom.repo 
[faircom]
name=FairCom Packages
baseurl=https://repo.faircom.com/repository/yum/el7/x86_64/
enabled=1
gpgcheck=0
skip_if_unavailable=1

The scripts support dnf/yum (RHEL/Rocky/Alma), zypper (SLES), and apt (Debian/Ubuntu) package managers.

 

 
 

 

Install packages through the repository

Once configured, FairCom packages can be installed using system's package manager:

sudo dnf install -y faircom-mq

Example of running previous script

$ sudo dnf install -y faircom-mq
Updating and loading repositories:
Repositories loaded.
gpg: directory '/root/.gnupg' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
Package                                                                 Arch             Version                                                                  Repository                                    Size
Installing:
faircom-mq                                                             x86_64           5.1.5-173.260728.el7                                                     faircom                                  566.8 MiB
Transaction Summary:
Installing:         1 package
Total size of inbound packages is 71 MiB. Need to download 71 MiB.
After this operation, 567 MiB extra will be used (install 567 MiB, remove 0 B).
[1/1] faircom-mq-0:5.1.5-173.260728.el7.x86_64                                                                                                                              100% |  14.6 MiB/s |  70.7 MiB |  00m05s
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[1/1] Total                                                                                                                                                                 100% |  14.6 MiB/s |  70.7 MiB |  00m05s
Running transaction
[1/3] Verify package files                                                                                                                                                  100% |   7.0   B/s |   1.0   B |  00m00s
[2/3] Prepare transaction                                                                                                                                                   100% |   7.0   B/s |   1.0   B |  00m00s
[3/3] Installing faircom-mq-0:5.1.5-173.260728.el7.x86_64                                                                                                                   100% |  80.4 MiB/s | 567.8 MiB |  00m07s
>>> Running post-install scriptlet: faircom-mq-0:5.1.5-173.260728.el7.x86_64                                                                                                                                        
>>> Finished post-install scriptlet: faircom-mq-0:5.1.5-173.260728.el7.x86_64                                                                                                                                       
>>> Scriptlet output:                                                                                                                                                                                               
>>> Created symlink '/etc/systemd/system/multi-user.target.wants/faircom-mq.service' → '/usr/lib/systemd/system/faircom-mq.service'.                                                                                
>>>                                                                                                                                                                                                                 
Warning: skipped OpenPGP checks for 1 package from repository: faircom
Complete!
 
 

 

 

Manual package installation

FairCom packages can be downloaded and installed manually:

Download package:

curl -LSsO https://repo.faircom.com/repository/yum/el7/x86_64/faircom-mq-5.1.5-173.260728.el7.x86_64.rpm

Install package:

sudo dnf install -y ./faircom-mq-5.1.5-173.260728.el7.x86_64.rpm

Example of running previous script

$ curl -LSsO https://repo.faircom.com/repository/yum/el7/x86_64/faircom-mq-5.1.5-173.260728.el7.x86_64.rpm
$ sudo dnf install -y ./faircom-mq-5.1.5-173.260728.el7.x86_64.rpm
Updating and loading repositories:
Fedora 42 - x86_64 - Updates                                                                                                                                               100% |   7.4 KiB/s |   3.4 KiB |  00m00s
Repositories loaded.
gpg: directory '/root/.gnupg' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
Package                                                                 Arch             Version                                                                  Repository                                    Size
Installing:
faircom-mq                                                             x86_64           5.1.5-173.260728.el7                                                     @commandline                             566.8 MiB
Transaction Summary:
Installing:         1 package
Total size of inbound packages is 71 MiB. Need to download 0 B.
After this operation, 567 MiB extra will be used (install 567 MiB, remove 0 B).
Running transaction
[1/3] Verify package files                                                                                                                                                  100% |   7.0   B/s |   1.0   B |  00m00s
[2/3] Prepare transaction                                                                                                                                                   100% |   9.0   B/s |   1.0   B |  00m00s
[3/3] Installing faircom-mq-0:5.1.5-173.260728.el7.x86_64                                                                                                                   100% |  80.2 MiB/s | 567.8 MiB |  00m07s
>>> Running post-install scriptlet: faircom-mq-0:5.1.5-173.260728.el7.x86_64                                                                                                                                        
>>> Finished post-install scriptlet: faircom-mq-0:5.1.5-173.260728.el7.x86_64                                                                                                                                       
>>> Scriptlet output:                                                                                                                                                                                               
>>> Created symlink '/etc/systemd/system/multi-user.target.wants/faircom-mq.service' → '/usr/lib/systemd/system/faircom-mq.service'.                                                                                
>>>                                                                                                                                                                                                                 
>>>                                                                                                                                                                                                                 
Warning: skipped OpenPGP checks for 1 package from repository: @commandline
Complete!
 
 

 

Package repository location

The RPM packages (RHEL/Rocky/Alma/SLES) are located in https://repo.faircom.com/yum/el8/ or https://repo.faircom.com/yum/el7/ for legacy systems in specific architecture subdirectories: x64_86, i386, aarch64, armhfp.


Example

https://repo.faircom.com/repository/yum/el7/i386

The package file name format is: {product-name}-{version}-{build}.{build-date}.el{linux-release}.{architecture}.rpm


Example

faircom-mq-5.1.5-169.260720.el7.i686.rpm

The DEB packages (Debian/Ubuntu) are located in https://repo.faircom.com/apt/current/ or https://repo.faircom.com/apt/legacy/ for legacy systems.

The package file name format is: {product-name}_{version}-{build}.{build-date}+glibc{glibc-version}_{architecture}.deb


Example

faircom-mq_5.1.5-169.260720+glibc2.16_amd64.deb
  1. Download the .tar file and move it to a directory where your current user account has full permissions.
    1. It is common to move the .tar file to the user folder — for example, if the .tar file is named FairCom-Edge.linux.x64.64bit.v4.5.1.170.230227.tar.gz the mv FairCom-Edge.linux.x64.64bit.v4.5.1.170.230227.tar.gz ~/user command will move it to the user directory.
  1. Use the tar command to expand the .tar file to create a new subdirectory that contains the FairCom server — for example, if the .tar file is named FairCom-Edge.linux.x64.64bit.v4.5.1.170.230227.tar.gz the tar -xvzf FairCom-Edge.linux.x64.64bit.v4.5.1.170.230227.tar.gz command will expand it.
    1. The subdirectory has a long name that includes the product name, target operating system, and the server version — for example, FairCom-Edge.linux.64bit.v4.5.1.145.
  1. Run the cd command followed by the name of the subdirectory to change the active directory to the newly installed subdirectory — for example, if the subdirectory is named FairCom-Edge.linux.64bit.v4.5.1.145 the cd FairCom-Edge.linux.64bit.v4.5.1.145 command will change the active directory to the subdirectory.
  2. Some Linux variants, including Ubuntu and CentOS, require the installation of a compression library for the FairCom server to launch correctly. Use the following commands to install the needed libraries:
    1. Ubuntu
      1. sudo apt install zlib1g-dev
    2. CentOS
      1. sudo yum install zlib-devel
  3. Type ./faircom and Enter to temporarily start the server and run it in the current terminal session.
    1. You can stop the server by closing the terminal session.
  4. Type ./startserver and Enter to start the server in the background and keep it running even when you close the terminal session.
  5. To stop the server:
  • Open a new terminal session.
  • Use the cd command to change the active directory to the server subdirectory.
  • Type ./stopserver and Enter.

 

Run the server in production

 

Run multiple instances

You can run multiple instances of FairCom on the same computer by configuring them to use different ports.

Note: Attempting to run a second instance of FairCom with the same ports as a running instance will cause the second instance to exit with errors

 

Check for running instances of FairCom

  1. Run the command: ps -ef | grep faircom.
  2. Observe the response.
    • Two lines of code indicate there is a FairCom server running.
    • One line of code indicates there is no FairCom server running.

 

Start or stop the FairCom server

Start

Start the FairCom server on Linux, Raspbian, 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 &.

 

Script to start and stop the server

On Unix/Linux systems, a script can start and stop the FairCom server. The script can be used to integrate the FairCom server as a startup service in systems where SystemD manages 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 (such as /lib/systemd/system on CentOS 7), the systemctl system tool can be used to manage FairCom as a system service — for example, to enable the ctree.service at startup, use the systemctl enable ctree.service command.

Because the Unix/Linux packages are distributed as .tar.gz archives, the location of the extracted files cannot be controlled. Therefore, Example 1, “Script to start and stop the server” may need to be edited to match the paths used on your system.

In Example 1, “Script to start and stop the server”,

  • Because the systemd tool must launch the service as root, uncomment the line
    A User= keyword may be used to start the service as a specified user:
  • Uncomment the #User=myuser line.
  • Change myuser to the desired user name 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.
    • Including a password in the script is against security policy in most production environments.

Script to start and stop the server

This sample script, 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

 

Stop

Linux, and MacOS users can use the included stop scripts to initiate a server shutdown. The script is in <faircom>/server/stopserver.

This script is provided as a "C" shell script and will work in most Linux shell environments. You are free to modify and tailor it to suit your local requirements.

These scripts must be run from the folder that contains them.

Other ways of stopping the FairCom server include:
  • ctadmn
    The ctadmn utility provides an option to shut down the server. Only administrator users can run it.
  • <faircom>\tools\ctstop.exe
    The ctstop utility can shut down the server. Only administrator users can run it.
  • 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. The FairCom database engine traps the SIGSTOP signal.
    1. Use the ps command to find a process with faircom or ctree in the results.
    2. Kill any process that contains either faircom or ctree in the name.
ps -e | grep faircom

If the FairCom server process is running, you will see it (see, Example 4, “Stop a script”).

Older versions of the FairCom products called the process "ctreesql" or "ctreeedge".

Stop a script

Use "kill 7288" in this example.

7288 pts/0 00:00:06 faircom
#kill <faircom PID>