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 4018) - 28 March 2024

Legacy Cumulus 1 release v1.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

CUtils launch as a service

Discussion of the Cumulusutils tool and website generator.

Moderator: HansR

Post Reply
AndyKF650
Posts: 704
Joined: Thu 20 Aug 2020 8:35 am
Weather Station: Davis VP2 Plus
Operating System: RPiv4 64bit Linux 12 Bookworm
Location: Jersey Channel Islands
Contact:

CUtils launch as a service

Post by AndyKF650 »

Hi Hans

Following on from this mornings permission based issue which we sorted by enabling mono into the setup code, reminded me of a similar start up procedure in CMX and wondered if this could be utilised in CUtils.

After a bit of trial and error I created a new file cumulusutils.service in the CumulusMX/MXutils/linux folder, copied it into /etc/systemd/system/and then enabled the service. The attached file shows the detailed steps needed.

The end result is an automatic service to restart CUtils following a file upgrade with no infernal errors. I am not sure if this will interfer with other CUtils processes but at the moment it works for me.
You do not have the required permissions to view the files attached to this post.
User avatar
HansR
Posts: 5871
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: CUtils launch as a service

Post by HansR »

Hi Andy,

Nice experiment :D

But:
  • Cutils has no code to run as a service and I have no idea what it will do but I think that as soon as it sees it has no argument it will stop.
  • I am not sure what the systemd does with a stopped daemon but as no action for a stop is given it will probably disappear (check with htop the process is no longer running)
  • What would you want to achieve as a service while there is no argument to CUtils?
  • Cutils has no signal handling so how would you like to communicate with CUtils while in daemon loop?
  • If your goal is to have mono permanently but it probably already is active (xsp4 and CumulusMX itself)
Although I could think of Cutils as a service, because it has repetitive actions like the 24 hr and 10 minute actions which are now accomplished by crontab, there is no code in CUtils to loop/sleep while it is doing nothing. It is programmed a a classic single shot activation with arguments with some output to those arguments.

What you made is the start/stop definition for systemd to tell it is has a daemon to look at, but the daemon as such is badly programmed as a daemon and won't function.

Nice idea though, as I said: there is functionality which could justify a daemon implementation but I don't think it will be done shortly.

Regards,
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
AndyKF650
Posts: 704
Joined: Thu 20 Aug 2020 8:35 am
Weather Station: Davis VP2 Plus
Operating System: RPiv4 64bit Linux 12 Bookworm
Location: Jersey Channel Islands
Contact:

Re: CUtils launch as a service

Post by AndyKF650 »

Hi Hans

As you say a nice experiment but on reflection and after the overnight thrifty website run not working I have killed and removed this service from the RPi. I think it may well cause more issues than it solved.

I am now back to the previous permission error fix which is completely workable and only needs to be done once when an upgrade is installed.
User avatar
HansR
Posts: 5871
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: CUtils launch as a service

Post by HansR »

Hi Andy,

OK, understood.

You can also invoke CUtils always preceded with 'mono'. Solves the issue as well.

Regards,
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
Post Reply