# Use a timeout for inventory scripts

**URL:** <https://hub.mender.io/t/use-a-timeout-for-inventory-scripts/5265>\
**Category:** General Discussions\
**Tags:** inventory\
**Created:** [September 20, 2022, 8:39pm UTC](https://hub.mender.io/t/use-a-timeout-for-inventory-scripts/5265 "2022-09-20T20:39:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@eric](https://hub.mender.io/u/eric)\
**Post date:** [September 20, 2022, 8:39pm UTC](https://hub.mender.io/t/use-a-timeout-for-inventory-scripts/5265/1 "2022-09-20T20:39:37Z")

</div>

(This is a feature request. To the best of my knowledge / searching, it has not already been implemented. Please close this thread if it already exists.)

**Problem:**

- If a particular inventory script hangs (e.g. while querying a peripheral), this can cause the Mender service to block at the `Sync_Enter` step. We can observe the (hung) inventory script via `ps`; killing the inventory pid unblocks the Mender service.
- The obvious workaround for this problem is to use the `timeout` command. However, this would be better enforced by the Mender service to maximize availability.

**Proposed solution:**

- It would be desirable to have an inventory script execution timeout, similar to [StateScriptTimeoutSeconds](https://docs.mender.io/client-installation/configuration-file/configuration-options#statescriptretrytimeoutseconds).

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [September 22, 2022, 5:14am UTC](https://hub.mender.io/t/use-a-timeout-for-inventory-scripts/5265/2 "2022-09-22T05:14:06Z")

</div>

That makes sense, @eric, and I don’t think we have [a task for it](https://tracker.mender.io/).

I’m not sure if this will be prioritized though. As always, contributions are welcome!
