# How to pause an update indefinitely for a power cycle: State Script vs DBus?

**URL:** <https://hub.mender.io/t/how-to-pause-an-update-indefinitely-for-a-power-cycle-state-script-vs-dbus/7979>\
**Category:** General Discussions\
**Tags:** state-scripts, dbus\
**Created:** [September 1, 2025, 3:36pm UTC](https://hub.mender.io/t/how-to-pause-an-update-indefinitely-for-a-power-cycle-state-script-vs-dbus/7979 "2025-09-01T15:36:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trab40](https://avatars.discourse-cdn.com/v4/letter/t/90db22/32.png) [@Trab40](https://hub.mender.io/u/Trab40)\
**Post date:** [September 1, 2025, 3:36pm UTC](https://hub.mender.io/t/how-to-pause-an-update-indefinitely-for-a-power-cycle-state-script-vs-dbus/7979/1 "2025-09-01T15:36:30Z")

</div>

Hello everyone,

I am trying to implement an update that completes its installation but waits for a manual power cycle to reboot and commit the new image. I have found two possible methods but see some conflicting information and would appreciate some clarification.

**State Script Approach**

The documentation for state scripts suggests this is possible. It contains a [tip](https://docs.mender.io/artifact-creation/state-scripts#power-loss) that stalling in the `ArtifactReboot_Enter` state script will wait for a power cycle without failing the update.

> Tip: Since a power loss in ArtifactReboot\_Enter will not be marked as a failure, this enables the user to stall the daemon in ArtifactReboot\_Enter state forever, and thus an install will only be installed on a power cycle of the device.

My plan was to use an `ArtifactReboot_Enter` script with a simple infinite loop, like this:

```shell
#!/bin/sh
while true; do
    sleep 3600
done
exit 0

```

However, [another forum](https://hub.mender.io/t/aborting-a-deployment-purposely-stalled-in-the-artifactreboot-enter-state/5009) post indicates this will not work as intended. It says the Mender client will eventually time out the script, to prevent loops bricking the device. I think this timeout is set by the **StateScriptTimeoutSeconds** parameter, which defaults to one hour. This seems to contradict the documentation’s tip about stalling “forever”.

Could you clarify if the script timeout will indeed prevent this approach from working? Is the documentation tip perhaps outdated or applicable only in specific configurations?

**Update Control Framework Approach**

The same forum post suggested using the [DBus API and the Update Control framework](https://docs.mender.io/client-installation/use-the-device-side-api) as an alternative to pause the update flow indefinitely. The documentation points to a Python example for this.

My main concern here is that the [GitHub repository](https://github.com/mendersoftware/mender-client-python-example) containing this example (`mender-client-python-example`) is archived. This makes me unsure if this is still a relevant or recommended solution.

Is using the DBus API still the correct way to achieve an indefinite pause? If so, are there any current examples or documentation available that I should be looking at?

**Question** : What is the current best practice for having a Mender update wait indefinitely for a user to power cycle the device before it reboots? Should I be using the state script method, and if so, how do I correctly configure it to avoid a timeout? Or is the DBus API the recommended path?

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![Trab40](https://avatars.discourse-cdn.com/v4/letter/t/90db22/32.png) [@Trab40](https://hub.mender.io/u/Trab40)\
**Post date:** [September 3, 2025, 12:58pm UTC](https://hub.mender.io/t/how-to-pause-an-update-indefinitely-for-a-power-cycle-state-script-vs-dbus/7979/2 "2025-09-03T12:58:50Z")

</div>

After further investigation, I’ve confirmed that the **D-Bus API for synchronized updates is deprecated** as of Mender 3.6.

While the documentation was somewhat unclear, the [Mender 3.6 release notes](https://mender.io/blog/mender-3-6-auto-generation-of-delta-updates#:~:text=Deprecation:%2520Synchronized%2520updates) are explicit. They state that the synchronized updates feature is being used when “Setting the control map on the device using the [DBus API](https://docs.mender.io/device-side-api/io.mender.update1#io-mender-update1-setupdatecontrolmap).”

Several other findings support this conclusion:

1. Running the `gdbus` call to set the update control map returns `(0,)`, which is an unexpected result for a `refresh_timeout`.

```shell
sudo gdbus call --system --dest io.mender.UpdateManager --object-path /io/mender/UpdateManager --method io.mender.Update1.SetUpdateControlMap '{"priority": 1, "states": {"ArtifactInstall_Enter": {"action": "pause"}}, "id": "01234567-89ab-cdef-0123-456789abcdef"}'

```

2. The official [mender-client-python-example repository](https://github.com/mendersoftware/mender-client-python-example) on GitHub is archived and produces an error when run.
3. The [forum post](https://hub.mender.io/t/aborting-a-deployment-purposely-stalled-in-the-artifactreboot-enter-state/5009) I was referencing was created before the Mender 3.6 release, when the feature was still active.

With the D-Bus option unavailable, the only viable solution seems to be to increase `StateScriptTimeoutSeconds` in `/etc/mender/mender.conf` to something like 12 hours and use the state script outlined in my initial post.

On a related note, I feel that a limitation of the Mender client is the lack of a simple interface for observing its current status on the device side. While state scripts are effective for reacting to state changes and they can export these changes to other applications on the system, they do not seem to provide a mechanism for tracking other useful metrics, such as real-time download progress. Maybe a unix socket that outputs state information would already be enough. Something to think about!

---

<div class="post-metadata">

**Author:** ![danieldrabitzius](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@danieldrabitzius](https://hub.mender.io/u/danieldrabitzius)\
**Post date:** [September 4, 2025, 9:21am UTC](https://hub.mender.io/t/how-to-pause-an-update-indefinitely-for-a-power-cycle-state-script-vs-dbus/7979/3 "2025-09-04T09:21:13Z")

</div>

Hey, I would suggest taking a look at [retry later](https://docs.mender.io/artifact-creation/state-scripts#retry-later), [StateScriptRetryTimeoutSeconds](https://docs.mender.io/client-installation/configuration/configuration-options#statescriptretrytimeoutseconds) and [StateScriptRetryIntervalSeconds](https://docs.mender.io/client-installation/configuration/configuration-options#statescriptretryintervalseconds).
