KB Article #178278
Sample systemd service unit file
Problem
-- Most systems are now using systemd as the default init system.
-- managedomain before 7.7.20231130 (Nov 23) could only generate initd files for API Gateway system services.
-- managedomain from 7.7.20231130 (Nov 23) and later has been updated. It creates systemd service files which use the start and stop functions from the old initd script - now installed in /usr/local/bin
-- The sample files presented here are simple standalone systemd files that can be used to convert any API Gateway server components into system services, with no requirement to run managedomain.
Resolution
- There are 3 files, one for cassandra, one for API Gateway instance and one for NodeManager.
- These service file ensure that API Gateway instance wait for cassandra to be fully available before starting.
- To use it, edit the file according to your environment (these are only samples !), as example, the name of the .pid file depends on the id of the node manager/instance in the API Gateway topology, and copy them under /usr/lib/systemd/system/ (or the path where unit service file is on your system).
- Then, to start a service, use:
# systemctl start service_name.service
- To make it start automatically at system boot:
# systemctl enable service_name.service
Depending on your operating system and configuration it is possible that you need to configure SELinux to allow the services to be run. This can be done with the following commands:
sudo semanage fcontext -a -t bin_t '/opt/Axway/apigateway/posix/bin.*'
sudo chcon -Rv -u system_u -t bin_t '/opt/Axway/apigateway/posix/bin'
sudo restorecon -R -v '/opt/Axway/apigateway/posix/bin'
Note: Replace "/opt/Axway/apigateway/posix/bin" with your API Gateway installation directory.
- For more information, please refer to systemd documentation