Tracking states of Mender Client

Hi,

I’m using hosted mender and my software updates are using the directory module. My application is a system service running python scripts running on a headless RPi. The application is responsible for enabling and connecting a cellular modem and then powering down the device (sudo shutdown) to save power. In the field this process could take 20 seconds once the cellular modem connects i.e. from starting to transfer data to shutting down the connection. I would like to keep track of the mender-client state so my main application can:

  1. I leave the cell modem on long enough for mender-client to check the server
  2. After the update has been successfully applied the application can perform a graceful shutdown

I am aware of this thread and it seems that best practice is to use state scripts to pipe states to a file. Since the discussion was about standalone mender I just wanted to ask if there was anything built into the mender-client running in hosted mode i.e. Dbus, etc.

If I was to use state scripts to pipe mender-client status to a file is there any status that are passed to the scripts when they are called i.e. some values representing Idle, Artificat Commit, etc.

Thanks,

Since the discussion was about standalone mender I just wanted to ask if there was anything built into the mender-client running in hosted mode i.e. Dbus, etc.

It is the same mechanism when running in managed mode (hosted mode). More information on state-scripts can be found here:

https://docs.mender.io/artifact-creation/state-scripts

If I was to use state scripts to pipe mender-client status to a file is there any status that are passed to the scripts when they are called i.e. some values representing Idle, Artificat Commit, etc.

There is no in going information provided to state-scripts, but as you create scripts representing states, indirectly you will know which state you are running.

Thanks for the explanation @mirzak