Created
November 25, 2014 13:35
-
-
Save bubba-h57/a1ce78dcca4337cb1b73 to your computer and use it in GitHub Desktop.
There are a number of scenarios wherein apache will fail to start on vagrant up because it relies on filesystems that are not yet mounted when it attempts to start. This upstart script solves the challenge by waiting for the vagrant-mounted event, and then starting up the service.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vagrant-apache - manages our apache service, and starts it once vagrant is ready | |
# | |
# Ubuntu Installation: | |
# /usr/bin/sudo /bin/cp ./vagrant-apache.conf /etc/init/vagrant-apache.conf | |
# /usr/bin/sudo /bin/chmod 644 /etc/init/vagrant-apache.conf | |
# /usr/bin/sudo /bin/ln /lib/init/upstart-job /etc/init.d/vagrant-apache | |
description "Manage Apache in Vagrant" | |
author "Bubba Hines <rob@stechstudio.com>" | |
start on vagrant-mounted | |
exec sudo service apache2 start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment