Upgrade mender client

Hi,
Is it possible to upgrade the mender-client itself using mender?

Let’s say I an a VM with a single connection to a mender server. Can I create an artifact to upgrade the Mender client?
I assume OS artifact can handle that, however is it possible with a lighter artifact on non-partitioned disks?

Thank you!

@zivkapl it absolutely is. In the simplest case you can just use a single-file artifact. If there is a config format change or other migration requirement, you might either use state scripts or go for a custom update module. So it’s definitely possible.

Greets,
Josef

Hi @TheYoctoJester thanks
I tried to change the service file for mender (to inject some HOSTALIASES env var to it to resolve to the server) and it requires a restart of the mender client which fails the upgrade.
Is it possible to restart the mender client using the mender upgrade?

Hi @zivkapl,

Yeah, would have guessed that restarting through a state script while the update is in progress will have such an effect.

At least out of the box, I don’t there is a mechanism for that. Some ideas:

  • rebooting, that will obviously restart the client. It is quite easy to craft an Update Module that is essentially single-file, but with a successive reboot.
  • using some scripting/trickery to delay the Mender Client restart until after the artifact installation.
  • extending the Client to support such a feature. PRs welcome, alternatively you can get in touch with us for feature development.

Greets,
Josef

1 Like