Mender update status file after deployment

Hi,

we use mender for deploy our rpi3 images. After deployment the
rpi has to call back to mender. also we have some ansible scripts
which load at start. now sometimes we have the problem, that we’ve
to restart the mender service, because we change the mender.conf.
we bridged that with a uptime check of 10min. Maybe it gives a better solution
for check, if the call back to mender is ok or in which state the deployment actually is.
Because, if we restart de mender service before he has callback after deploy, a rollback is activated.

We have no yocto image in use. We use raspian stretch at this time.

Thanks for your response.

greets Phil

Hi @dubachphil welcome to Mender Hub. Thanks for your contribution.

It sounds to me like you need to use Mender state script for this. See https://docs.mender.io/2.1/artifacts/state-scripts for details.

Basically, if you provide your logic as a PostCommit state script, then it will be done after the commit operation has completed so no rollback will occur. Of course depending on your needs with regard to changing the mender.conf file, that may have other implications. If you can describe a bit more about your scenario here, we may have other suggestions.

@mirzak, @kacf, @lluiscampos any other ideas?

Drew

Are you using ansible to change mender.conf? Make a systemd unit file with a oneshot section and WantedBy=mender.service, and call ansible (or whatever changes mender.conf) from within there. That will make the client launch only after you have already made the changes. Make sure you use WantedBy and not RequiredBy. This guarantees that the client will eventually launch, even if you make a mistake in your ansible configuration.

More information can be found about systemd.unit and systemd.service in the systemd docs.