systemd script for CumulusMX
Posted: Mon 27 Feb 2017 11:42 am
Hi,
Wonder if anyone can help me please.
I have got CumulusMX up and running on a Ubuntu 16.04.2 LTS box running under VirtualBox. I have a Fine Offset WH-1081 station (actually a Maplin N96GY), so had to compile and install mono-complete 4.0.5.1 to get that to work. So far, so good, and loving CumulusMX's new look compared to Cumulus 1.
Currently, to start CumulusMX I simply do:
cd /opt/CumulusMX
sudo /opt/mono/bin/mono CumulusMX.exe
I have tried to create a systemd .service file to enable automatic starting of CumulusMX on boot. My file, which I have placed at /lib/systemd/system/cumulusmx.service is as follows:
[Unit]
Description=CumulusMX Service
[Service]
Type=forking
WorkingDirectory=/opt/CumulusMX
ExecStart=/opt/mono/bin/mono-service CumulusMX.exe
Restart=always
[Install]
WantedBy=multi-user.target
I have done 'sudo systemctl enable cumulusmx' [worked fine] and then 'sudo systemctl start cumulusmx' but this does not quite work. If I then do 'sudo systemctl status cumulusmx' I get:
\u25cf cumulusmx.service - "CumulusMX Service"
Loaded: loaded (/lib/systemd/system/cumulusmx.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2017-02-27 10:48:38 GMT; 46min ago
Main PID: 11566 (mono)
CGroup: /system.slice/cumulusmx.service
\u2514\u250011566 /opt/mono/bin/mono /opt/mono/lib/mono/4.5/mono-service.exe /opt/CumulusMX/CumulusMX.exe
Feb 27 10:48:37 ubuntu16 systemd[1]: Starting CumulusMX Service...
Feb 27 10:48:38 ubuntu16 systemd[1]: Started CumulusMX Service.
Feb 27 10:48:38 ubuntu16 mono[11566]: /opt/CumulusMX/CumulusMX.exe: Directory 'MXdiags' not found.
It looks as though I need to define the location of the 'MXdiags' subdir somehow - I had hoped that the 'Working Directory' declaration in the .service file, but doesn't look like it is working. Is there a way I can specify the location of 'MXDiags' in the 'ExecStart' line?
Grateful for any ideas anyone may have on this.
Thanks
Mark
Wonder if anyone can help me please.
I have got CumulusMX up and running on a Ubuntu 16.04.2 LTS box running under VirtualBox. I have a Fine Offset WH-1081 station (actually a Maplin N96GY), so had to compile and install mono-complete 4.0.5.1 to get that to work. So far, so good, and loving CumulusMX's new look compared to Cumulus 1.
Currently, to start CumulusMX I simply do:
cd /opt/CumulusMX
sudo /opt/mono/bin/mono CumulusMX.exe
I have tried to create a systemd .service file to enable automatic starting of CumulusMX on boot. My file, which I have placed at /lib/systemd/system/cumulusmx.service is as follows:
[Unit]
Description=CumulusMX Service
[Service]
Type=forking
WorkingDirectory=/opt/CumulusMX
ExecStart=/opt/mono/bin/mono-service CumulusMX.exe
Restart=always
[Install]
WantedBy=multi-user.target
I have done 'sudo systemctl enable cumulusmx' [worked fine] and then 'sudo systemctl start cumulusmx' but this does not quite work. If I then do 'sudo systemctl status cumulusmx' I get:
\u25cf cumulusmx.service - "CumulusMX Service"
Loaded: loaded (/lib/systemd/system/cumulusmx.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2017-02-27 10:48:38 GMT; 46min ago
Main PID: 11566 (mono)
CGroup: /system.slice/cumulusmx.service
\u2514\u250011566 /opt/mono/bin/mono /opt/mono/lib/mono/4.5/mono-service.exe /opt/CumulusMX/CumulusMX.exe
Feb 27 10:48:37 ubuntu16 systemd[1]: Starting CumulusMX Service...
Feb 27 10:48:38 ubuntu16 systemd[1]: Started CumulusMX Service.
Feb 27 10:48:38 ubuntu16 mono[11566]: /opt/CumulusMX/CumulusMX.exe: Directory 'MXdiags' not found.
It looks as though I need to define the location of the 'MXdiags' subdir somehow - I had hoped that the 'Working Directory' declaration in the .service file, but doesn't look like it is working. Is there a way I can specify the location of 'MXDiags' in the 'ExecStart' line?
Grateful for any ideas anyone may have on this.
Thanks
Mark