Use a timeout for inventory scripts

(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:

That makes sense, @eric, and I don’t think we have a task for it.

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