Update shell.html.md

Putting sleep after the reboot didn't work for me. It would just hang indefinitely. There's a better way, and it's "pause_before".
This commit is contained in:
evanstucker-hates-2fa 2016-10-04 09:19:26 -07:00 committed by GitHub
parent bddb2c25f2
commit cd10cef218
1 changed files with 6 additions and 4 deletions

View File

@ -159,12 +159,14 @@ scripts. The amount of time the provisioner will wait is configured using
Sometimes, when executing a command like `reboot`, the shell script will return Sometimes, when executing a command like `reboot`, the shell script will return
and Packer will start executing the next one before SSH actually quits and the and Packer will start executing the next one before SSH actually quits and the
machine restarts. For this, put a long `sleep` after the reboot so that SSH will machine restarts. For this, put use "pause_before" to make Packer wait before executing the next script:
eventually be killed automatically:
``` {.text} ``` {.text}
reboot {
sleep 60 "type": "shell",
"script": "script.sh",
"pause_before": "10s"
}
``` ```
Some OS configurations don't properly kill all network connections on reboot, Some OS configurations don't properly kill all network connections on reboot,