Auto-start using systemd
This section describes how to auto-start MFT Server on a Linux system running systemd.
The first step is the creation of a unit file. Before proceeding, read the note below.
sudo systemctl disable server.service
. This file is not created if you installed MFT server using the zip installer or if you used the RPM installer running under a non-root user.
-
Create a systemd unit file and place it in the /etc/systemd/system directory.
-
For the above example, the file name is mftserver.service. The base name is whatever you would like (using Linux naming rules), but the suffix must be service.
-
Copy the information below, and paste it into your newly created unit file.
[Unit]
Description=JSCAPE MFT Server
After=network.target
[Service]
Type=forking
User=jscapeuser
ExecStart=/opt/mft_server/server start
ExecStop=/opt/mft_server/server stop
[Install]
WantedBy=multi-user.target
-
See the following notes that describe changes you may need to make to the unit file contents.
-
Delete the "User=" line if you intend to run MFT Server under the root account (not recommended as a best practice).
-
Modify the two references to “/opt/mft_server” to point to your installation path if MFT Server is not installed in /opt/mft_server,
-
-
Test starting and stopping MFT Server using the unit file. The start and stop commands below reference a unit file named mftserver.service. Your base file name may be different.
-
Test the unit file to ensure MFT Server starts. Do this before enabling it for autostart on reboot. The command to execute is:
sudo systemctl start mftserver
-
Test the unit file to ensure MFT Server stops. The command to execute is:
sudo systemctl stop mftserver
-
-
Reload the systemd daemon, which in turn loads the new service file, by executing this command:
sudo systemctl daemon-reload
-
Install the service unit so that MFT Server is auto-started upon a system reboot, by executing this command:
sudo systemctl enable mftserver.service
-
Start MFT Server by executing this command:
sudo systemctl start mftserver.service
-
Verify the service is running by executing this command:
sudo systemctl status mftserver.service
. You should see output that indicates the service is active and running.
If you encounter any issues, examine the systemd logs for error messages.
-
Enter this command:
sudo journalctl -u mftserver.service
You can also check the JSCAPE MFT Server logs, located in the /opt/mft_server/logs directory, for more detailed information. As a reminder, opt/mft_server is the default MFT Server installation directory name.