Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using Vagrant getting a shell script issue and failure

I have the following details:

Vagrant File:

Vagrant.configure("2") do |config|
 config.vm.box = "Precise32"
 config.vm.box_url = "http://files.vagrantup.com/precise32.box"
 config.vm.synced_folder "./Public","/var/www/",create:true
 config.vm.network :private_network, ip: "192.168.55.55"
 config.vm.provision :shell, :path => "setup.sh"
end

Shell File:

   sudo apt-get -y update
   sudo apt-get install apache2 php5 libapache2-mod-php5 
   sudo sudo apachectl restart

  The shell is s little limited but i want to get it to work first before i attempt all the other php stuff etc


  The error i get starts here:

  Do you want to continue [Y/n]? Abort.
  The following SSH command responded with a non-zero exit status.
  Vagrant assumes that this means the command failed!

  chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell

  Stdout from the command:

then continues with trying to get or hit files

  Fetched 3,018 kB in 4s (681 kB/s)
  Reading package lists...
  Reading package lists...
  Building dependency tree...
  Reading state information...
  The following extra packages will be installed:
    apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1
    libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert
  Suggested packages:
    www-browser apache2-doc apache2-suexec apache2-suexec-custom
    openssl-blacklist
  The following NEW packages will be installed:
    apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common
    libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert
  0 upgraded, 10 newly installed, 0 to remove and 155 not upgraded.
  Need to get 1,845 kB of archives.
  After this operation, 5,314 kB of additional disk space will be used.
  Do you want to continue [Y/n]? Abort.


  Stderr from the command:

  stdin: is not a tty

i have even tried:

   config.vm.network :forwarded_port, host: 3003, guest: 3000

And thats it failure, althought when i do go to localhost:3000 or that i get:

   SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1
   Protocol mismatch.

I am on a MAC OSX 10.8.5

also the sections where it say Do you want to continue [Y/n]?

i don't get to choose it automatically does this for me.

like image 616
Simon Davies Avatar asked Mar 03 '26 08:03

Simon Davies


1 Answers

Can you try adding a '-y' to apt-get install? like: sudo apt-get -y install apache2 php5 libapache2-mod-php5 to overcome the 'Do you want to continue [Y/n]'? - nikhil

like image 60
hrishikeshp19 Avatar answered Mar 05 '26 23:03

hrishikeshp19