From fff968eb5a3e324b2218c7f6659c844615f43fce Mon Sep 17 00:00:00 2001 From: Mark Peek Date: Tue, 20 Aug 2013 14:07:21 -0700 Subject: [PATCH] website: add a troubleshooting section for the shell provisioner --- .../docs/provisioners/shell.html.markdown | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/website/source/docs/provisioners/shell.html.markdown b/website/source/docs/provisioners/shell.html.markdown index a41ccb1b9..0d1eaec7a 100644 --- a/website/source/docs/provisioners/shell.html.markdown +++ b/website/source/docs/provisioners/shell.html.markdown @@ -127,3 +127,23 @@ reboot so that SSH will eventually be killed automatically: reboot sleep 60 ``` + +## Troubleshooting + +*My shell script doesn't work correctly on Ubuntu* + +* On Ubuntu the /bin/sh shell is +[dash](http://en.wikipedia.org/wiki/Debian_Almquist_shell). If your script has +[bash](http://en.wikipedia.org/wiki/Bash_(Unix_shell\)) specific commands in it +then put `#!/bin/bash` at the top of your script. Differences +between dash and bash can be found on the [DashAsBinSh](https://wiki.ubuntu.com/DashAsBinSh) Ubuntu wiki page. + +*My shell works when I login but fails with the shell provisioner* + +* See the above tip. More than likely your login shell is using /bin/bash +while the provisioner is using /bin/sh. + +*How do I tell what my shell script is doing?* + +* Adding a `-x` flag to the shebang at the top of the script (`#!/bin/sh -x`) +will echo the script statements as it is executing.