docs/dev/design_documents/client_exit_codes.md
Chef-client exit codes signal outside tools to the result of the Chef-Client run.
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 the node to reboot, and continue converging.
All exit codes defined should be usable on all supported Chef Platforms. Also, the exit codes used should be identical across all platforms. That limits the total range from 1-255. Exit codes not explicitly used by Linux/Windows are listed below. There are 59 exit codes that are available on both platforms.
| Exit Code | Reason | Details |
|---|---|---|
| 35 | Reboot Scheduled | Reboot has been scheduled in the run state |
| 37 | Reboot Needed | Reboot needs to be completed |
| 41 | Reboot Failed | Initiated Reboot failed - due to permissions or any other reason |
| Exit Code | Reason | Details |
|---|---|---|
| -1 | Failed execution* | Generic error during Chef execution. On Linux this will show up as 255, on Windows as -1 |
| 0 | Successful run | Any successful execution of a Chef utility should return this exit code |
| 1 | Failed execution | Generic error during Chef execution. |
| 2 | SIGINT received | Received an interrupt signal |
| 3 | SIGTERM received | Received an terminate signal |
| 42 | Audit Mode Failure | Audit mode failed, but chef converged successfully. |
| 43 | Invalid config | Exit due to invalid configuration |
| 213 | Client upgrade | Chef has exited during a client upgrade |
If there is a need for additional exit codes, please open a Design Proposal PR to discuss the change, and then a PR to update this document.