Page 1 of 1

CumulusMX as a service

Posted: Mon 31 Aug 2020 7:15 am
by billy
In recent months I have run mx in screen, and prior to that via the start/stop management script. Today I decided to try running it as a service using the instructions Mark provided with the b3090 announcement (I'm using the latest b3093). I'm logged on as a regular user (ie not root), go to the CumulusMX directory, and use
sudo mono-service -l:/var/run/cmx.pid CumulusMX.exe -service.

It starts as expected, with everything working fine. I can then shut it down with
sudo kill `sudo cat /var/run/cmx.pid`
(both "sudo's" seem to be required). The log files indicate the shutdown.

Then the problem - I try and start MX again with the same command (ie sudo mono-service -l:/var/run/cmx.pid CumulusMX.exe -service) but nothing seems to happen. Only a reboot allows this method to work again (although I can simply use the standard sudo mono CumulusMX.exe successfully).

The only thing that is clear is that I don't understand what I am doing. I'd be grateful if someone could point me in the right direction.

Re: CumulusMX as a service

Posted: Mon 31 Aug 2020 8:20 am
by HansR
Check the log file, that is most probable because the lockfile (the pid file) still exists.
In the init.d procedure delivered in the distribution - see release notes - it does actually delete the lockfile.
The way you do it, you must do it manually.

So I would advise you to use the procedure given by the distribution (manually or through init.d) or use systemd as a most recent discussion showed.

Re: CumulusMX as a service

Posted: Mon 31 Aug 2020 8:57 am
by billy
HansR wrote: Mon 31 Aug 2020 8:20 am Check the log file, that is most probable because the lockfile (the pid file) still exists.
In the init.d procedure delivered in the distribution - see release notes - it does actually delete the lockfile.
The way you do it, you must do it manually.

So I would advise you to use the procedure given by the distribution (manually or through init.d) or use systemd as a most recent discussion showed.
Hans, thanks.

There is no log file produced when run a second time.

And I tried the init.d script first - it didn't behave well in my hands, so I went back to square one and tried the "manual" procedure as described in the release.

And there doesn't seem to be a lock file. From the init.d script I expect it to be /tmp/cmx.pid but that doesn't exist :?

Re: CumulusMX as a service

Posted: Mon 31 Aug 2020 9:04 am
by billy
aha ... I see the lock file is in /var/run
I will explore further

Re: CumulusMX as a service

Posted: Mon 31 Aug 2020 10:32 am
by freddie
Hi Billy,

Take a look at this post. No need for a script or to worry about removing the lock file. Just a simple config file in which you put in the location of your MX installation.

Re: CumulusMX as a service

Posted: Mon 31 Aug 2020 1:08 pm
by billy
Hi Freddie,

That's fantastic - thank you very much. It worked wonders - like a gentle breeze on a hot summer's day (which is about 4 months away for me - well the hot bit, probably not the gentle breeze) :lol: I haven't automated backups since I went to screen so I look forward to seeing some ideas about this in the near future :)