Update strategy: Update-then-reboot

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

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.

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).

@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?

Hi Farzad,
I wonder if 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 …