# Mender update status file after deployment

**URL:** <https://hub.mender.io/t/mender-update-status-file-after-deployment/1155>\
**Category:** General Discussions\
**Created:** [October 16, 2019, 12:49pm UTC](https://hub.mender.io/t/mender-update-status-file-after-deployment/1155 "2019-10-16T12:49:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubachphil](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@dubachphil](https://hub.mender.io/u/dubachphil)\
**Post date:** [October 16, 2019, 12:49pm UTC](https://hub.mender.io/t/mender-update-status-file-after-deployment/1155/1 "2019-10-16T12:49:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [October 16, 2019, 1:27pm UTC](https://hub.mender.io/t/mender-update-status-file-after-deployment/1155/2 "2019-10-16T13:27:06Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [October 16, 2019, 1:56pm UTC](https://hub.mender.io/t/mender-update-status-file-after-deployment/1155/3 "2019-10-16T13:56:58Z")

</div>

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](https://www.freedesktop.org/software/systemd/man/systemd.unit.html) and [systemd.service](https://www.freedesktop.org/software/systemd/man/systemd.service.html) in the systemd docs.
