# Reboot twice per upgrade

**URL:** <https://hub.mender.io/t/reboot-twice-per-upgrade/6988>\
**Category:** General Discussions\
**Tags:** mender-client\
**Created:** [July 4, 2024, 12:12pm UTC](https://hub.mender.io/t/reboot-twice-per-upgrade/6988 "2024-07-04T12:12:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zivkapl](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/zivkapl/32/2061_2.png) [@zivkapl](https://hub.mender.io/u/zivkapl)\
**Post date:** [July 4, 2024, 12:12pm UTC](https://hub.mender.io/t/reboot-twice-per-upgrade/6988/1 "2024-07-04T12:12:27Z")

</div>

Hi Guys,  
I have several Mender clients that are running Ubuntu 18.  
I want to upgrade them all to Ubuntu 22 but cannot use the OS upgrade.  
I want to upgrade it per Ubuntu’s Instructions, by calling `apt` and similar commands to pull the official Ubuntu 20, and later ubuntu 22.

I want to use the mender client `single-file` or (some similar custom update module), however, the OS upgrade process requires 2 reboots - one after getting to Ubuntu 20, and another after 22.

Is doing more than a single reboot supported?  
Or must I use 2 artifacts one for each OS upgrade process?  
Do you have any idea how to use mender for that?

Thanks!

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [July 4, 2024, 12:23pm UTC](https://hub.mender.io/t/reboot-twice-per-upgrade/6988/2 "2024-07-04T12:23:07Z")

</div>

Hi @zivkapl,

My gut feeling is that a custom Update Module is the way to go, basically a hybrid of the `single-file` and `script` one, but offloading the actual process until after the file has actually be deployed, then hooking into OS mechanisms for triggering the upgrade process. It pretty sure can be done, but will require very careful crafting of the mechanism, and a lot of testing and safeguarding as such a script that does not use the A/B mechanism has no rollback and therefore introduces a lot of breaking points.

Some material for thought:

- making sure the `mender-connect` service stays alive so you can at least interactively try to fix things
- or repartition and introduce the A/B setup

Greets,  
Josef
