diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-10-13 11:34:14 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-10-13 11:34:14 -0700 |
commit | 8d62921ef82fad3b545baa81c2a50715a8120857 (patch) | |
tree | ceccaa0d302ab7ed3feacbf4bd8ee2756506122f /lib/chef/platform | |
parent | 71f4a954d0fd7c9cb0a636c5503e25c7cf46e9bd (diff) | |
download | chef-8d62921ef82fad3b545baa81c2a50715a8120857.tar.gz |
fix rebooter for solaris and background rebootsfix-linux-rebooter
closes #5026
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/platform')
-rw-r--r-- | lib/chef/platform/rebooter.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/chef/platform/rebooter.rb b/lib/chef/platform/rebooter.rb index 33a6e24be2..430d175869 100644 --- a/lib/chef/platform/rebooter.rb +++ b/lib/chef/platform/rebooter.rb @@ -33,14 +33,18 @@ class Chef def reboot!(node) reboot_info = node.run_context.reboot_info - cmd = if Chef::Platform.windows? + cmd = case + when Chef::Platform.windows? # should this do /f as well? do we then need a minimum delay to let apps quit? # Use explicit path to shutdown.exe, to protect against https://github.com/chef/chef/issues/5594 windows_shutdown_path = "#{ENV['SYSTEMROOT']}/System32/shutdown.exe" "#{windows_shutdown_path} /r /t #{reboot_info[:delay_mins] * 60} /c \"#{reboot_info[:reason]}\"" + when node["os"] == "solaris2" + # SysV-flavored shutdown + "shutdown -i6 -g#{reboot_info[:delay_mins]} -y \"#{reboot_info[:reason]}\" &" else - # probably Linux-only. - "shutdown -r +#{reboot_info[:delay_mins]} \"#{reboot_info[:reason]}\"" + # Linux/BSD/Mac/AIX and other systems with BSD-ish shutdown + "shutdown -r +#{reboot_info[:delay_mins]} \"#{reboot_info[:reason]}\" &" end msg = "Rebooting server at a recipe's request. Details: #{reboot_info.inspect}" |