Running mender-client on demand

Hi,

I am new to Mender and would like your opinion on our use-case. We have a system performing measurements, so we do not want the mender-client to run from time to time. On the other hand when we want to upgrade our unit we would like to use both the mender-client and server.

I plan to add one line to mender-client.service
ConditionPathExists=/var/lib/mender/software_change_active_flag

And when a software change is required do:
Create the file software_change_active_flag and start mender-client.service.

In a state script (ArtifactCommit_Leave_…) or when software change should be aborted do:
Remove the file software_change_active_flag and stop mender-client.service.

Is this a feasible solution or should I do this some other way?

Best regards,
Jonny

I don’t see anything wrong with this but it will require an out-of-band mechanism to know that the software change is required.

You could simplify it a bit by simply using a DownloadEnter state script set to retry until your software stack is ready for updates to occur. This would have the benefit of not doing anything if there is no artifact to download.

Drew

Hi Drew,

thanks for the response. I will look into your suggestion and see which solution we prefer.

Jonny