Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Problems Starting As A service

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

User avatar
The Dalek Hunter
Posts: 342
Joined: Wed 05 Aug 2020 11:51 am
Weather Station: Vantage Pro 2, Ecowitt GW2000
Operating System: macOS Sonoma on a Mac Mini M2
Contact:

Problems Starting As A service

Post by The Dalek Hunter »

I am running CMX on a Raspberry Pi 4b booting from a USB hard disk.
I installed it by hand rather than using the image.

It has been running perfectly and I was starting it on boot up using @reboot (sleep 30;cd /home/pi/CumulusMX;sudo mono CumulusMX.exe) & as a Cron job.

I decided to try to start it as a service so as per instructions I copied cumulusmx.service to my /etc/systemd/system/ folder and edited it like this

[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/pi/CumulusMX CumulusMX.exe -service
Type=forking
ExecStopPost=/bin/rm /tmp/CumulusMX.exe.lock

[Install]
WantedBy=multi-user.target

If I now issue a sudo a sudo systemctl start cumulusmx, sudo systemctl stop cumulusmx or sudo systemctl status cumulusmx it all works fine.

However if I do a sudo systemctl enable cumulusmx and then reboot CumulusMX never starts and sudo systemctl status cumulusm gives the following error.

Apr 26 07:21:04 CumulusMX-Pi systemd[1]: Starting CumulusMX service...
Apr 26 07:21:05 CumulusMX-Pi systemd[1]: Started CumulusMX service.
Apr 26 07:21:15 CumulusMX-Pi mono[366]: CumulusMX.exe: Object reference not set to an instance of an object.

Any suggestions ?
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Problems Starting As A service

Post by mcrossley »

Please look in the MXdiags log file and see if there is a clue in there.
User avatar
The Dalek Hunter
Posts: 342
Joined: Wed 05 Aug 2020 11:51 am
Weather Station: Vantage Pro 2, Ecowitt GW2000
Operating System: macOS Sonoma on a Mac Mini M2
Contact:

Re: Problems Starting As A service

Post by The Dalek Hunter »

Ok - when attempting to start as a service here is the last few lines of the MXdiag log - when started via a Cron Job these lines do not appear
You do not have the required permissions to view the files attached to this post.
freddie
Posts: 2870
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 24.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Problems Starting As A service

Post by freddie »

Looks like a DNS problem to me. DNS may not be available to resolve any FQDNs in the MX config at start-up. Sounds like it is available normally, but possibly not just when MX is starting on a reboot. So a timing issue.
Freddie
Image
User avatar
The Dalek Hunter
Posts: 342
Joined: Wed 05 Aug 2020 11:51 am
Weather Station: Vantage Pro 2, Ecowitt GW2000
Operating System: macOS Sonoma on a Mac Mini M2
Contact:

Re: Problems Starting As A service

Post by The Dalek Hunter »

So could I put a delay in the startup in CMX and how long should I put in?
You do not have the required permissions to view the files attached to this post.
freddie
Posts: 2870
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 24.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Problems Starting As A service

Post by freddie »

A delay is a good idea. I would suggest experimenting with perhaps 60 seconds, then reducing it until you encounter the original error.
Freddie
Image
User avatar
The Dalek Hunter
Posts: 342
Joined: Wed 05 Aug 2020 11:51 am
Weather Station: Vantage Pro 2, Ecowitt GW2000
Operating System: macOS Sonoma on a Mac Mini M2
Contact:

Re: Problems Starting As A service

Post by The Dalek Hunter »

As the start by Cron has a delay of 30 seconds I tried that and it now starts perfectly.
I will leave it at that without any further meddling :)

Many many thanks.
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Problems Starting As A service

Post by mcrossley »

Could you post the whole log file please.

I already have a fix for a DNS crash during the start-up ping in the next release, but your ping host is blank so that should not be coming into play, it looks like it is crashing somewhere else.
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Problems Starting As A service

Post by mcrossley »

As you are running a WLL, if your have a Pro account I'd recommend that your set the start-up ping to "www.weatherlink.com", that ensures the Davis cloud is reachable before Cumulus attempts to download historic data from it during catch-up. You would want to set a ping escape time to something sensible too, otherwise Cumulus would never start if Davis was unreachable (or MX thought it was).

Though there is that DNS crash issue in the current version, so maybe hold off until the next release. :( :bash:
User avatar
The Dalek Hunter
Posts: 342
Joined: Wed 05 Aug 2020 11:51 am
Weather Station: Vantage Pro 2, Ecowitt GW2000
Operating System: macOS Sonoma on a Mac Mini M2
Contact:

Re: Problems Starting As A service

Post by The Dalek Hunter »

As I said above - I have put in a startup delay of 30 seconds under Program settings -> Start-up Delay (secs) and all is now well.
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Problems Starting As A service

Post by mcrossley »

I'd still like teh log file though please. The delay is avoiding the issue, I'd like to get it fixed.
User avatar
The Dalek Hunter
Posts: 342
Joined: Wed 05 Aug 2020 11:51 am
Weather Station: Vantage Pro 2, Ecowitt GW2000
Operating System: macOS Sonoma on a Mac Mini M2
Contact:

Re: Problems Starting As A service

Post by The Dalek Hunter »

Sorry

Been away from my computer for a while.

How do I enable Diags when starting as a service ?
freddie
Posts: 2870
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 24.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Problems Starting As A service

Post by freddie »

Stop MX. Search for DebugLogging=0 in your Cumulus.ini file and change the 0 to 1. Then save and restart MX.
Freddie
Image
User avatar
The Dalek Hunter
Posts: 342
Joined: Wed 05 Aug 2020 11:51 am
Weather Station: Vantage Pro 2, Ecowitt GW2000
Operating System: macOS Sonoma on a Mac Mini M2
Contact:

Re: Problems Starting As A service

Post by The Dalek Hunter »

DebugLogging=0 not found in Cumulus.ini
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Problems Starting As A service

Post by mcrossley »

You will have to add it into the [station] section - with Cumulus Stopped.
Post Reply