Zuehlke / cookbook-elk-stack

0 stars 1 forks source link

Permissions for provisioning script not correct #2

Closed damphyr closed 8 years ago

damphyr commented 8 years ago

Fresh virtual box installation, git clone and then vagrant up:

13:35 $ vagrant up
Bringing machine 'elastic-test' up with 'virtualbox' provider...
==> elastic-test: Box 'boxcutter/ubuntu1404' could not be found. Attempting to find and install...
    elastic-test: Box Provider: virtualbox
    elastic-test: Box Version: >= 0
==> elastic-test: Loading metadata for box 'boxcutter/ubuntu1404'
    elastic-test: URL: https://atlas.hashicorp.com/boxcutter/ubuntu1404
==> elastic-test: Adding box 'boxcutter/ubuntu1404' (v2.0.7) for provider: virtualbox
    elastic-test: Downloading: https://atlas.hashicorp.com/boxcutter/boxes/ubuntu1404/versions/2.0.7/providers/virtualbox.box
==> elastic-test: Successfully added box 'boxcutter/ubuntu1404' (v2.0.7) for 'virtualbox'!
==> elastic-test: Importing base box 'boxcutter/ubuntu1404'...
==> elastic-test: Matching MAC address for NAT networking...
==> elastic-test: Checking if box 'boxcutter/ubuntu1404' is up to date...
==> elastic-test: Setting the name of the VM: cookbook-elk-stack_elastic-test_1446900630892_18238
==> elastic-test: Clearing any previously set network interfaces...
==> elastic-test: Preparing network interfaces based on configuration...
    elastic-test: Adapter 1: nat
==> elastic-test: Forwarding ports...
    elastic-test: 22 => 2223 (adapter 1)
    elastic-test: 80 => 8080 (adapter 1)
==> elastic-test: Running 'pre-boot' VM customizations...
==> elastic-test: Booting VM...
==> elastic-test: Waiting for machine to boot. This may take a few minutes...
    elastic-test: SSH address: 127.0.0.1:2223
    elastic-test: SSH username: vagrant
    elastic-test: SSH auth method: private key
    elastic-test: Warning: Connection timeout. Retrying...
    elastic-test:
    elastic-test: Vagrant insecure key detected. Vagrant will automatically replace
    elastic-test: this with a newly generated keypair for better security.
    elastic-test:
    elastic-test: Inserting generated public key within guest...
    elastic-test: Removing insecure key from the guest if it's present...
    elastic-test: Key inserted! Disconnecting and reconnecting using new SSH key...
==> elastic-test: Machine booted and ready!
==> elastic-test: Checking for guest additions in VM...
==> elastic-test: Setting hostname...
==> elastic-test: Mounting shared folders...
    elastic-test: /vagrant => /Users/var/Projects/Z/Zuehlke/GitHub/cookbook-elk-stack
==> elastic-test: Running provisioner: shell...
    elastic-test: Running: inline script
==> elastic-test: /tmp/vagrant-shell: line 1: /vagrant/scripts/update-vm.sh: Permission denied
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
damphyr commented 8 years ago

The permissions on the freshly mounted vagrant are missing the execution bit.

Login in and chmod 755 the update-vm.sh script allows it to run.

tknerr commented 8 years ago

git update-index --chmod=+x scripts/update-vm.sh and committing that should do the trick, see http://stackoverflow.com/a/13593391/2388971

a-zen commented 8 years ago

Interesting that I didn't had any problems, even though the update-vm.sh script already existed and I too only cloned the repository.

damphyr commented 8 years ago

@a-zen that's probably because you started the VM off Windows and I did it on OS X and maybe on OS X it inherits the permissions from the share (and those did not include the execution bit). Pure conjecture.