# Update strategy: Update-then-reboot

**URL:** <https://forums.balena.io/t/update-strategy-update-then-reboot/2293>\
**Category:** Product support\
**Created:** [December 14, 2017, 11:53am UTC](https://forums.balena.io/t/update-strategy-update-then-reboot/2293 "2017-12-14T11:53:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![niklasnorin](https://avatars.discourse-cdn.com/v4/letter/n/eb9ed0/32.png) [@niklasnorin](https://forums.balena.io/u/niklasnorin)\
**Post date:** [December 14, 2017, 11:53am UTC](https://forums.balena.io/t/update-strategy-update-then-reboot/2293/1 "2017-12-14T11:53:10Z")

</div>

We are running a custom ResinOS version and so have our own well defined behaviour when booting the device from scratch.

Would it be possible to have a “update-then-reboot” strategy where an application update is always followed by a reboot?

When the device boots again, it would be running the new version.

Best regards,  
Niklas

---

<div class="post-metadata">

**Author:** ![Farzad](https://avatars.discourse-cdn.com/v4/letter/f/e47774/32.png) [@Farzad](https://forums.balena.io/u/Farzad)\
**Post date:** [April 1, 2019, 11:55pm UTC](https://forums.balena.io/t/update-strategy-update-then-reboot/2293/2 "2019-04-01T23:55:25Z")

</div>

Hi Balena team,

I am wondering if there is any solution for this post since I am also looking for a way to reboot the system after deployment.

---

<div class="post-metadata">

**Author:** ![gelbal](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/gelbal/32/1109_2.png) [@gelbal](https://forums.balena.io/u/gelbal)\
**Post date:** [April 4, 2019, 2:58pm UTC](https://forums.balena.io/t/update-strategy-update-then-reboot/2293/13 "2019-04-04T14:58:09Z")

</div>

Hi @Farzad and @niklasnorin,

That’s an interesting idea. Thanks for the suggestion. I’ll create a feature request on your behalf in our internal system.

Until we build such a feature, could you embed such logic into your deployment code?

So you could use balena API / SDK to check after you make a deployment, when the application is on a new version, you trigger a reboot command right after (via API / SDK as well).

---

<div class="post-metadata">

**Author:** ![Farzad](https://avatars.discourse-cdn.com/v4/letter/f/e47774/32.png) [@Farzad](https://forums.balena.io/u/Farzad)\
**Post date:** [April 4, 2019, 4:24pm UTC](https://forums.balena.io/t/update-strategy-update-then-reboot/2293/15 "2019-04-04T16:24:17Z")

</div>

@gelbal thank you for your response. We are using Python SDK inside containers to restart them. How can we monitor that from the container itself? does supervisor provide any information to create the trigger?

---

<div class="post-metadata">

**Author:** ![samothx](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@samothx](https://forums.balena.io/u/samothx)\
**Post date:** [April 4, 2019, 8:47pm UTC](https://forums.balena.io/t/update-strategy-update-then-reboot/2293/16 "2019-04-04T20:47:50Z")

</div>

Hi Farzad,  
I wonder if [https://www.balena.io/docs/reference/supervisor/supervisor-api/#get-v2applicationsstate](https://www.balena.io/docs/reference/supervisor/supervisor-api/#get-v2applicationsstate) will do the job for you. I am thinking in the ways of comparing the release ID to a saved value. If the saved value is different from the retrieved value - save the new value and reboot.  
Of course you would have to be very careful to not run into a boot loop …
