For a systemd service, its configuration is stored in a file known as a
unit. To create a unit for Cumulus MX, create a file called cumulusmx.service in /etc/systemd/system/. Pop this code into the file:
Code: Select all
[Unit]
Description=CumulusMX service
Documentation=https://cumuluswiki.org/a/Main_Page
After=network-online.target
[Service]
User=root
Group=root
ExecStart=/usr/bin/mono-service -d:/home/install/CumulusMX CumulusMX.exe -service
Type=forking
ExecStopPost=/bin/rm /tmp/CumulusMX.exe.lock
[Install]
WantedBy=multi-user.target
[Service] section notes: you should modify the
ExecStart line to suit your system.
/usr/bin/mono-service is the path to the mono-service executable (should be pretty standard across all systems, but I would double-check it is there).
-d:/home/install/CumulusMX is the location of your Cumulus MX installation. Also, modify
User and
Group to suit your local setup. Lastly,
ExecStopPost=/bin/rm /tmp/CumulusMX.exe.lock is for systemd to remove the lock file created on service startup in order to signal successful startup/shutdown.
Cumulus is started and stopped with the following commands:
Code: Select all
systemctl start cumulusmx
systemctl stop cumulusmx
Status and restart are available too:
Code: Select all
systemctl restart cumulusmx
systemctl status cumulusmx
If you make a change to the unit file, you need to run the following command so that systemd re-reads your file:
There is no need to do this when you first create the unit file.
To have Cumulus start on reboot, issue the following command:
Finally, to stop the service running on reboot, use the following:
NOTE:
All the above systemctl commands should be run as root (or prefixed with sudo) - except for status which can be executed by a normal user.
The unit file can be called whatever you want, provided it is suffixed with
.service. If you do decide to use another name then you will need to use this name with your systemctl commands.