Before and after deployment hooks

Hi all,

Admittedly new here (first post) and to Mender. I had a few questions I was unable to find answers to and hoping for a little guidance. I’m using Mender 2.0 + Pi 3b + Debian Stretch, running a hosted Mender PoC. I searched the forum already, but was unable to locate answers.

  1. When provisioning a new Raspberry Pi image, it it possible to run commands on the device before the new image is downloaded and swapped? The thought was to write some things to persistent storage before a new image is applied (i.e. current state configuration file).

  2. Is there an easy way to take my running image out of demo mode so it checks for update more frequently? When I deploy a new image, I think it’s taking 30 minutes to poll the server for a new deployment. Wonder if theres a setting or command I can run on an already baked images to force a poll prematurely.

Thanks

Hi @tmrskos,

When provisioning a new Raspberry Pi image, it it possible to run commands on the device before the new image is downloaded and swapped? The thought was to write some things to persistent storage before a new image is applied (i.e. current state configuration file).

For this you can use state-scripts,

https://docs.mender.io/2.0/artifacts/state-scripts

Is there an easy way to take my running image out of demo mode so it checks for update more frequently? When I deploy a new image, I think it’s taking 30 minutes to poll the server for a new deployment. Wonder if theres a setting or command I can run on an already baked images to force a poll prematurely.

I am assuming that you are using mender-convert for which you can use the --demo flag to enable more frequent polling.

Otherwise you can modify /etc/mender/mender.conf and specifically this parameter,

 "UpdatePollIntervalSeconds": 1800

This is what I was looking for, thanks for the information.