Let user start update

Hi!

I’m considering Mender for a project where we need the updates to be user initiated. I.e. something like the behavior of a smartphone or other system with a UI. What we need to achieve is something like this:

  1. User clicks a “Check for Updates” button in the UI (a website served by a local webserver running on the device). Info is displayed about the update/if it is available.
  2. User clicks start update. Update progress is displayed.

1 is optional it’s fine if the user just clicks update and then it updates if an update is available.

It’s also important that the user can update whenever they want. These devices are seldom connected to the internet and the user needs to be able to update even if the update was released 1 month ago.

Is this possible with Mender?

I think you could set mender-client service to disabled, so that it doesn’t start manually, and then enable it whenever you want to update. Haven’t done it myself, but I would look in that direction.

Thanks for the suggestion! But unfortunately that seems a bit to hacky to use in a real product.

you have 2 options as i have been through this process for my companies product line.

  1. use async state scripts to achieve what you need with the existing mender client
  2. write you own client the uses the mender rest api

after a extensive review and testing process we went for the second option, but your requirements may be different.

Not at all, I remember a similar advice in Mender docs.
https://docs.mender.io/artifact-creation/standalone-deployment

Using the rest api seems like a good option, thanks!

Expanding a bit on this: Use a Sync state script to check some condition. Usually it returns 1 to signal “do not proceed with update”. If the user clicks the button to update, change the condition and call mender check-update to trigger another execution of the script. When it returns 0, the update can continue.