Interaction between state scripts and Update Control Maps

I am reading over the information on the Use the Device-side API | Mender documentation page and it is unclear what effect the Update Control Maps have on existing state scripts.

For background, we are trying to setup a system where the state scripts normally prevent an update from running while the product is on but we need a way for the user to force an update to run anyways. From the docs the following items are unclear:

  • Should I be using continue or force_continue? What is the difference between them?
  • Will all the state scripts still be run?
  • Is the output from the state scripts still checked to determine if the update can continue?

I will answer out of order, since it will be clearer then.

Update Control Maps and State Scripts are completely independent, so the only way they can influence each other is indirectly, by controlling which will be the next state the client will go to. For any state where both State Scripts and Update Control are supported, the order will be Update Control action -> State Script Enter -> Actual State -> State Script Leave. However, at any point, either Update Control or State Scripts can fail and divert the client, sending it to a different state, so it’s possible only the first of those four will be reached.

continue and force_continue are only relevant in comparison to other Update Control Maps. continue will continue the update as long as there are no other Update Control Maps (for example from the server) which specify pause or fail (priority doesn’t matter). force_continue however, forces the update to continue even if there is a map with lower priority which specifies pause or fail.

I would consider a completely different solution: Set UpdatePollIntervalSeconds very high, and rely on mender check-update to trigger updates instead. This means the client will never check on its own, but it will check when the user triggers it.