summaryrefslogtreecommitdiff
path: root/lib/mixlib/shellout/unix.rb
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-11-04 08:40:47 -0800
committerdanielsdeleo <dan@opscode.com>2013-11-04 08:40:47 -0800
commit4ff2d130c3d6e68a30340175b5ce0b164ce26220 (patch)
treecc73fa22f67ff31ba6dbfebab54706147b899e79 /lib/mixlib/shellout/unix.rb
parent99001519bb950cda8983a8f270b45845ce349a45 (diff)
downloadmixlib-shellout-4ff2d130c3d6e68a30340175b5ce0b164ce26220.tar.gz
Add logging about timed-out cmd termination when possible
If a logger is configured, send `error` level messages about child process termination for timeout violations.
Diffstat (limited to 'lib/mixlib/shellout/unix.rb')
-rw-r--r--lib/mixlib/shellout/unix.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/mixlib/shellout/unix.rb b/lib/mixlib/shellout/unix.rb
index 546d3ee..2ffa5cd 100644
--- a/lib/mixlib/shellout/unix.rb
+++ b/lib/mixlib/shellout/unix.rb
@@ -302,9 +302,11 @@ module Mixlib
def reap_errant_child
return if attempt_reap
+ logger.error("Command execeded allowed execution time, sending TERM") if logger
Process.kill(:TERM, @child_pid)
sleep 3
return if attempt_reap
+ logger.error("Command did not exit from TERM, sending KILL") if logger
Process.kill(:KILL, @child_pid)
reap