Add timeout to salt.state.cmd.* functions
Would like the ability to specify a timeout for an arbitrary command:
Example:
mycommand:
cmd.run:
- name: command-that-could-hang
- timeout: 60
If the timeout is reached, the command should be marked as failed. If timeout is reached, the subprocess should be killed (possibly via sigterm and then following up with a sigkill if it still exists).
Note: this is completely unrelated to the "--timeout" CLI option.
We'd be willing to submit a pull request, just wondering if there was a reason this feature isn't present as it's available in both Chef and Puppet.
Great idea! As far as I know there's no particular reason this hasn't been implemented.
Pull request was merged some time ago and I've confirmed that this feature works. Closing.