-
Log on to the Linux server as the user that runs the service, and confirm that the user account has
sufficient permissions to run the configuration scripts.
-
Run the following command:
InstallPath/linux_a64/code/command/StationAsAService-config
{-c}
path-to-cpr-file
service-name
Where the -c
parameter configures the Service to use CATSTART to start the station, which ensures
that the station uses the CATEnv parameters.
path-to-cpr-file is the location of the
.cpr file for the server login profile (usually
InstallPath/config), and
service-name is an optional parameter that lets you create the
station as a service with a custom name. If you do not specify the station as a
service name, it creates the station as a service using the default name,
SMAExeStation.
When StationAsAService-config runs to completion, it creates
a .service file.
-
Review the contents of the newly created
.service file to confirm
that the values are correct. A sample .service file appears in Sample Unit File for Linux to illustrate the file's syntax. Do the following to verify that the station is
configured correctly:
-
Start the station as the desired user, before running as a service, to make sure
the user can run the station without errors.
In this context, "user" refers to the user who executes the service. By default,
the configuration uses the user who created the service file. If required change the
desired user, and validate that the user has the proper permissions to read and
write to the station log and scratch directories.
-
Open the
.servicefile in a text editor, and increase the value
of SMAEXE_MEM if you want to allot more than 2 GB of memory to
it.
-
If the
.service file is correct, move it to
/etc/system/systemd.
-
To apply changes to the service file or any station property, stop, reload, and start
the service.
Sample Unit File for Linux
[Unit]
Description=Station as service on Linux
After=network.target
[Service]
User=<userThatRunsStation>
Environment=SMAEXE_HOME={InstallPath}/linux_a64
Environment=SMAEXE_CONF={InstallPath}/linux_a64/../config
Environment=SMAEXE_JRE={Java_Path}
Environment=SMAEXE_MEM=2G
ExecStart={InstallPath}/linux_a64/code/command/SMAExeStation
logonprompt:no user:fiperstation pw:fiperstation profile:<ProfileFile> name:<ServiceStationName> nogui:true
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.targetExample: Sample Service File with -c Flag
Used[Unit]
Description=Station as service on Linux
After=network.target
[Service]
User=<userThatRunsStation>
Environment=SMAEXE_HOME={InstallPath}/linux_a64
Environment=SMAEXE_CONF={InstallPath}/linux_a64/../config
Environment=SMAEXE_JVMPARMS=
Environment=SMAEXE_MEM=2G
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
ExecStart={InstallPath}/linux_a64/code/bin/CATSTART -e Env.txt
-direnv {InstallPath}/CATEnv -run
{InstallPath}/linux_a64/code/command/SMAExeStation
logonprompt:no user:fiperstation pw:fiperstation
profile:<ProfileFile> name:<ServiceStationName> nogui=true"
[Install]
WantedBy=multi-user.target