salt icon indicating copy to clipboard operation
salt copied to clipboard

Add timeout to salt.state.cmd.* functions

Open dlindquist opened this issue 13 years ago • 3 comments

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.

dlindquist avatar May 30 '13 19:05 dlindquist

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.

dlindquist avatar May 30 '13 19:05 dlindquist

Great idea! As far as I know there's no particular reason this hasn't been implemented.

basepi avatar May 30 '13 20:05 basepi

Pull request was merged some time ago and I've confirmed that this feature works. Closing.

terminalmage avatar Jul 19 '13 23:07 terminalmage