Page 1 of 1

Startup/Shutdown External Programs

Posted: Fri 15 Jan 2021 3:28 pm
by radilly
I like the idea of the new "Program settings", and this might be thought of as a generalization of that. If available, I would take advantage of the ability to run some code when Cumulus starts, and when it shuts down.

I was reminded of this in writing out viewtopic.php?f=36&t=18885 (Option to *Append* to ServiceConsoleLog.txt). If available, at shutdown one could make a backup copy of ServiceConsoleLog.txt, or append it to file located elsewhere - an alternative approach to that proposal.

Such a feature could, potentially be used to implement an alternative to the "Host to PING on program start-up" option. I believe some caveats are:
  • To replicate that function, the external program would have to block, i.e. Cumulus would not continue until control returns,
  • It would be convenient to be able to communicate back to Cumulus the desire to halt, e.g. through a return code or the like.
On the shutdown side, the other referenced suggestion mentions the desire to retain MXdiags logging. Today I run a crontab (Linux) that runs an rsych to copy any changed MXdiags logging periodically to another directory. (When I'm experimenting, I'm often restarting CMX frequently, and anecdotally it appears the number of logfiles is fixed, but, therefore, the amount of history retained can vary widely.)

Thanks!

Re: Startup/Shutdown External Programs

Posted: Sun 20 Nov 2022 9:38 pm
by mcrossley
I have implemented startup and shutdown tasks in v3.22.4

I do have some improvements to make to them in future...