OpenDataDevOps / minus

Minus github-pages branch. Minus helps Open Data teams and projects go from zero to hero faster by automating away configuration pain.
opendatadevops.org
11 stars 6 forks source link

Apache fails to install correctly on initial vagrant up. #13

Open gregelin opened 11 years ago

gregelin commented 11 years ago

Apache has failed to install correctly on every initial vagrant up. Apache does install correctly on first vagrant reload.

Excerpt of output of vagrant up with debug option on puppet set.

debug: Service[httpd](provider=redhat): Executing '/sbin/service httpd status'

debug: Puppet::Type::Service::ProviderRedhat: Executing '/sbin/chkconfig httpd'
debug: Service[httpd](provider=redhat): Executing '/sbin/service httpd start'
err: /Stage[main]//Service[httpd]/ensure: change from stopped to running failed: Could not start Service[httpd]: Execution of '/sbin/service httpd start' returned 1:  at /tmp/vagrant-puppet/manifests/manifests.pp:37
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q tomcat6-webapps --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
'
debug: Package[tomcat6-webapps](provider=yum): Ensuring => present

debug: Puppet::Type::Package::ProviderYum: Executing '/usr/bin/yum -d 0 -e 0 -y install tomcat6-webapps'

debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q tomcat6-webapps --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
'

notice: /Stage[main]//Package[tomcat6-webapps]/ensure: created
debug: /Stage[main]//Package[tomcat6-webapps]: The container Class[Main] will propagate my refresh event
debug: Exec[disable_iptable1](provider=posix): Executing 'iptables stop'

debug: Executing 'iptables stop'
notice: /Stage[main]//Exec[disable_iptable1]/returns: executed successfully

debug: /Stage[main]//Exec[disable_iptable1]: The container Class[Main] will propagate my refresh event

notice: /Stage[main]//File[/bin/lein]/mode: mode changed '0644' to '0755'

debug: /Stage[main]//File[/bin/lein]: The container Class[Main] will propagate my refresh event

debug: /Schedule[never]: Skipping device resources because running on a host

err: /Stage[main]//File[/var/www/html/vagrant]/ensure: change from absent to link failed: Could not set 'link on ensure: No such file or directory - /var/www/html at /tmp/vagrant-puppet/manifests/manifests.pp:67

Command line output of vagrant ssh and checking the /sbin commands are correct. /sbin/service httpd start fails but sudo /sbin/service httpd start succeeds.


Gregs-MacBook-Pro:minus gregelin$ vagrant ssh
Last login: Tue Jul 10 22:56:01 2012 from 10.0.2.2
[vagrant@localhost ~]$ ls /var/www//html/
index.html
[vagrant@localhost ~]$ ls /sbin/service
/sbin/service
[vagrant@localhost ~]$ /sbin/service httpd status
httpd is stopped
[vagrant@localhost ~]$ /sbin/service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]

[vagrant@localhost ~]$ sudo /sbin/service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
                                                           [  OK  ]

Finally everything works fine with vagrant reload (even without intermediary vagrant ssh and starting the service.

vagrant reload

debug: /Stage[main]//Exec[disable_iptable2]: The container Class[Main] will propagate my refresh event
debug: Service[httpd](provider=redhat): Executing '/sbin/service httpd status'
debug: Puppet::Type::Service::ProviderRedhat: Executing '/sbin/chkconfig httpd'
debug: Service[httpd](provider=redhat): Executing '/sbin/service httpd start'

debug: Puppet::Type::Service::ProviderRedhat: Executing '/sbin/chkconfig httpd'
debug: Puppet::Type::Service::ProviderRedhat: Executing '/sbin/chkconfig httpd on'
notice: /Stage[main]//Service[httpd]/ensure: ensure changed 'stopped' to 'running'

notice: /Stage[main]//File[/var/www/html/vagrant]/ensure: created

debug: /Stage[main]//File[/var/www/html/vagrant]: The container Class[Main] will propagate my refresh event

Could issue be with needing fully qualified domain name in /etc/hosts file, like below? Maybe hosts file is eventually getting change on completion of initial vagrant up or at start of vagrant reload?

::1 localhost.domain.com localhost
127.0.0.1 localhost.domain.com localhost
127.0.0.1 hostname.domain.com hostname

This is what my vagrant instance /etc/hosts/ file looks like after vagrant reload.

Gregs-MacBook-Pro:minus gregelin$ vagrant ssh
Last login: Tue Feb 26 11:07:22 2013 from 10.0.2.2
[vagrant@localhost ~]$ cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6