diff --git a/CHANGELOG.md b/CHANGELOG.md index 21cd0b6a5..e9131b4d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ BUG FIXES: * provisioner/ansible: set cwd to staging directory [GH-1016] * provisioners/chef-client: Don't chown directory with Ubuntu. [GH-939] * provisioners/shell: Env var values can have equal signs. [GH-1045] + * provisioners/shell: chmod the uploaded script file to 0777. [GH-994] * post-processor/docker-push: Allow repositories with ports. [GH-923] * post-processor/vagrant: Create parent directories for `output` path [GH-1059] diff --git a/provisioner/shell/provisioner.go b/provisioner/shell/provisioner.go index 9553d47fd..a5ec2e2bb 100644 --- a/provisioner/shell/provisioner.go +++ b/provisioner/shell/provisioner.go @@ -273,6 +273,16 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error { return fmt.Errorf("Error uploading script: %s", err) } + cmd = &packer.RemoteCmd{ + Command: fmt.Sprintf("chmod 0777 %s", p.config.RemotePath), + } + if err := comm.Start(cmd); err != nil { + return fmt.Errorf( + "Error chmodding script file to 0777 in remote "+ + "machine: %s", err) + } + cmd.Wait() + cmd = &packer.RemoteCmd{Command: command} return cmd.StartWithUi(comm, ui) })