Is there a shutdown warning or signal I can log to record updates or dashboard interactions?

Have you ever had a have hardware or software crash that occurred infrequently and so you run the code for a long time and examine the logs for success and failure?

Well I do, and when looking at my logs I was wondering if there is a warning, signal, or log I can look at to identify restarts of the container that were due to dashboard interactions, or updates being installed?

It would be really helpful to be able to differentiate between “the container restarted when you pushed that update” from “the container restarted because your docker CMD exited.”

I can use a “dirty” flag, and I do have a log line at the end of my CMD bash script that writes out when my main process stopped, exited with an error, segfaulted, etc. But this hardware I’m working on, well it does like to sometimes go crazy too!

Suggestions?

@jason10 the supervisor will first send the signal you defined in your docker-compose when trying to stop a container (this defaults to SIGTERM). You could catch this and perform some action on it. Does this help?

Yes, Thank you!

My searches led me to this approach, which has a bash script launching the program, catching the signal and forwarding it along. I will test it.