Hello,
I have a reboot block called from a ruby block
ruby_block “xxx” do
block
…
end…
notifies :reboot_now, ‘reboot[reboot_me]’, :immediate
end
reboot ‘reboot_me’ do
action :nothing
end
It does work and however I get following error
ERROR: Running exception handlers
Running handlers complete
ERROR: Exception handlers complete
Chef Client failed. 5 resources updated xxxxxx
FATAL: Stacktrace dumped xxxxxxx
FATAL: Please provide xxxxx
ERROR: Rebooting server at a recipe's request: {:delay_mins=>0; xxxxx}
FATAL: Chef::Exception::ChildConvergeError: Chef run process exited unsuccessfully (exit code 35)
I have tried to delay the reboot used delay_mins etc but I still get similar error, nothing interesting in stacktrace, what I may be doing wrong?
M
joris
March 15, 2018, 5:16pm
2
I think it’s working as expected.
Basically, you want your node to reboot so chef doesn’t exit successfully because you have yet to reboot.
class ExitCode
# -1 is defined as DEPRECATED_FAILURE in RFC 062, so it is
# not enumerated in an active constant.
#
VALID_RFC_062_EXIT_CODES = {
SUCCESS: 0,
GENERIC_FAILURE: 1,
SIGINT_RECEIVED: 2,
SIGTERM_RECEIVED: 3,
REBOOT_SCHEDULED: 35,
REBOOT_NEEDED: 37,
REBOOT_FAILED: 41,
AUDIT_MODE_FAILURE: 42,
CLIENT_UPGRADED: 213,
}
DEPRECATED_RFC_062_EXIT_CODES = {
DEPRECATED_FAILURE: -1,
}
Got it thanks
It makes sense now, but looking at the error, it looked dumb:-(
Thanks
M
1 Like
spuder
March 19, 2018, 2:39am
4
In chef 12, a reboot would return exit code 0
In chef 13, a reboot returns exit code 35
More details are in this RFC
The intent of this switch is so that at a future date, external tools will be able to detect if chef rebooted a vm and intelligently resume a chef-client run. Presently you need to leave behind some mechanism to run chef after the reboot (windows scheduled task, linux cron job).
---
RFC: 62
Title: Chef-Client Exit Codes
Author: Nicholas Carpenter <ncarpenter@ebsco.com>
Status: Final
Type: Standards Track
---
# Chef-Client Exit Codes
Signal outside tools of specific Chef-Client run status. Ability to determine results of a Chef-Client run.
## Motivation
As a Chef user,
I want to be able to determine when a chef-client run is rebooting the node,
so that Test-Kitchen/Vagrant/any outside tool can wait for node to reboot, and continue converging.
## Specification
This file has been truncated. show original