Systemd service template

Using the license manager systemd template allows you to run commands to stop and start the service using systemctl in Linux® systems.

A template for FLM systemd is provided in FLMDIR/systemd/flm.service

Warning:

The systemd feature is available on Linux only.

The template contains the service configuration options that allow you to control the FLM service via Linux systemctl commands. It contains the basic commands to use the service; you may want to adapt the template to suit your needs. For more information on working with systemd, see the systemd documentation.
An example of the systemd template, flm.service, is shown in the sample.
# Installed in the global system 
#
# /lib/systemd/system/flm.service
# systemctl daemon-reload
# systemctl stop flm.service
# systemctl start flm.service
# systemctl status flm.service
#
# Installed in user space
#
# ~/.config/systemd/user/flm.service
#
# systemctl --user daemon-reload
# systemctl --user stop flm.service
# systemctl --user start flm.service
# systemctl --user status flm.service

[Unit]
Description=FourJs License Manager 6.00.13-202303241116
After=network.target nss-lookup.target
Documentation=https://4js.com/online_documentation/fjs-flm-manual-html

[Service]
Type=exec
Environment="FLMDIR=/opt/fourjs/flm"
ExecSearchPath=/opt/fourjs/flm/bin
ExecStartPre=flmprg -a env
ExecStart=flmprg -D
ExecReload=flmprg --service-restart
ExecStop=flmprg --service-stop
KillMode=mixed
Restart=on-abort
SuccessExitStatus=SIGTERM 0
PrivateTmp=true

[Install]
WantedBy=multi-user.target
Where:
  • Examples of the systemctl commands you can use to manage the service are included in the comments at the top of the file.
  • The configuration items are in the [Unit], [Service], and [Install] sections.
  • The ExecSearchPath parameter specifies the path to the FLM for the service. It affects where systemd looks for the commands specified in ExecStart, ExecStop, and so one. This parameter was introduced in systemd version 250. If your version of systemd is earlier (run systemctl --version), you will need to include the complete path to the flmprg commands in the Exec* parameters.

Usage

There are different ways of using the template depending on your requirements. You can either set the service as a global service or as a user service. For this example we set it as a global system service:
  • Copy the FLMDIR/systemd/flm.service service file to the /lib/systemd/system directory.
  • Reload the systemd configuration:
    $ systemctl daemon-reload
  • Now you should be able to start, stop, and check the FLM service status.
    $ systemctl start flm.service
    $ systemctl stop flm.service
    $ systemctl status flm.service
  • To configure the service to start automatically on boot, you need to enable it:
    $ systemctl enable flm.service
  • To check the service logs, run:
    $ journalctl -u flm.service