How to Run Software Gateway as SystemD Service in Linux
search cancel

How to Run Software Gateway as SystemD Service in Linux


Article ID: 236188


Updated On:


CA API Gateway


The documentation for the Software Gateway is incomplete.  It shows how to configure the gateway with the script, but does not show how to set up the gateway as a service or start the gateway process to have it listen for connections.  

Need a document to configure gateway as a service upon installation.


Release : 10.1

Component : API GATEWAY


Run Software Gateway as SystemD Service in Linux

Systemd is a software application that provides an array of system components for Linux operating systems. It is the first service to initialize the boot sequence. This always runs with pid 1. This also helps use to manage system and application service on our Linux operating system.

+x /usr/bin/

To run a script once during system boot time doesn’t required any infinite loop. Instead you can use your shell script to run as Systemd service.  Below assume login as the root user in the server. 

1.  Create A SystemD File

Create a service file for the systemd on your system. This file must have .service extension and saved under the /lib/systemd/system/ directory

Now, add the following content and update the script filename and location. You can also change the description of the service.


Description=Sample SSG Shell Script


ExecStart=/opt/SecureSpan/Gateway/runtime/bin/ start


Say the service file created is called ssg.service


2.  Reload All Services

Your system service has been added to your service.  Reload the systemctl daemon to read new file.  You need to reload this deamon each time after making any changes in .service file.

>systemctl  daemon-reload

3.  Enable and Start New Service

Now enable the service to start on system boot, also start the service using the following commands.

> systemctl enable ssg.service

> systemctl start ssg.service

4 –  Verify the New Service

Finally verify the script is up and running as a systemd service.

  > systemctl status ssg.service  


> service ssg status


Note:  Due to timing of the script's execution,  the java process may fail to start when it check the process pid file which is need to moved to other directory.  

A sleep command is needed in to resolve the problem (attachment line 96). 

The modified the is attached. 



Attachments get_app