Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

systemd script for CumulusMX

Topics about the Beta trials up to Build 3043, the last build by Cumulus's founder Steve Loft. It was by this time way out of Beta but Steve wanted to keep it that way until he made a decision on his and Cumulus's future.

Moderator: mcrossley

Locked
MJFear
Posts: 5
Joined: Mon 21 Nov 2016 10:43 am
Weather Station: Maplin N96GY
Operating System: CentOS 6

systemd script for CumulusMX

Post by MJFear »

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
User avatar
ConligWX
Posts: 1618
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: systemd script for CumulusMX

Post by ConligWX »

If I'm not mistaken was Fine Offset Stations meant to use an older version of mono with CumulusMX?

also the MXdiags folder is part of the CumulusMX install, did you copy all the files and folders from the zip file?

Personally on my Debian install I copied all the folders/files (below) to the root inside \CumulusMX\ folder
You do not have the required permissions to view the files attached to this post.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0

Image
MJFear
Posts: 5
Joined: Mon 21 Nov 2016 10:43 am
Weather Station: Maplin N96GY
Operating System: CentOS 6

Re: systemd script for CumulusMX

Post by MJFear »

Thanks Toxic 17 - yes you are right about the mono version, that's why I had to manually compile and install mono 4.0.5.1 as neither 4.2.1 (which installs if you do 'sudo apt-get install mono-complete' or the very latest version work. I also had to find a fix to install libudev.so.0 (which I did like this http://gamblisfx.com/how-to-solve-missi ... ntu-16-04/.

The MXdiags directory is there, as I can see it and it works fine if I start the app manually.

Turns out......all I needed to do was reboot the box for some reason that I haven't yet fathomed. Possibly conflicting with the manually started version of CumulusMX (which I thought I had closed down, but maybe not).

Anyway, my script works fine, so guess we can mark this one closed!! :D
MJFear
Posts: 5
Joined: Mon 21 Nov 2016 10:43 am
Weather Station: Maplin N96GY
Operating System: CentOS 6

Re: systemd script for CumulusMX

Post by MJFear »

One little adjustment to the .service file for posterity - just noticed I had tried changing the ExecStart line to include the full CumulusMX path:

ExecStart=/opt/mono/bin/mono-service /opt/CumulusMX/CumulusMX.exe

As that seems to be working, that's how I'm going to leave it!!
jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

Re: systemd script for CumulusMX

Post by jank »

MJFear wrote:ExecStart=/opt/mono/bin/mono-service /opt/CumulusMX/CumulusMX.exe
Yes, I can confirm, this is working and systemd is an alternative to init.d.
[Unit]
Wants=network-online.target
After=network.target network-online.target

[Service]
WorkingDirectory=/home/pi/CumulusMX
ExecStart=/usr/bin/mono /home/pi/CumulusMX/CumulusMX.exe


Unfortunately, My Start/Stop script is not working with systemd. I assume Screen will not work together when systemd is daemonizing CumulusMX.
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
Locked