Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure apache starts on successive 'vagrant up' #307

Open
jeff1evesque opened this issue Jan 20, 2016 · 2 comments
Open

Ensure apache starts on successive 'vagrant up' #307

jeff1evesque opened this issue Jan 20, 2016 · 2 comments

Comments

@jeff1evesque
Copy link
Owner

We need to ensure apache starts on successive vagrant up. Currently, it seems apache is attempting to start before the shared directory mounts to /vagrant/webroot/:

[root@drupal-demonstration vagrant]# systemctl status httpd -l
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2016-01-20 12:26:43 EST; 58s ago

     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 1403 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 1239 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 1239 (code=exited, status=1/FAILURE)

Jan 20 7:26:43 drupal-demonstration.com systemd[1]: Starting The Apache HTTP Server...
Jan 20 7:26:43 drupal-demonstration.com httpd[1239]: AH00526: Syntax error on line 119 of /etc/httpd/conf/httpd.conf:
Jan 20 7:26:43 drupal-demonstration.com httpd[1239]: DocumentRoot '/vagrant/webroot' is not a directory, or is not readable
Jan 20 7:26:43 drupal-demonstration.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jan 20 7:26:43 drupal-demonstration.com kill[1403]: kill: cannot find process ""
Jan 20 7:26:43 drupal-demonstration.com systemd[1]: httpd.service: control process exited, code=exited status=1
Jan 20 7:26:43 drupal-demonstration.com systemd[1]: Failed to start The Apache HTTP Server.
Jan 20 7:26:43 drupal-demonstration.com systemd[1]: Unit httpd.service entered failed state.
Jan 20 7:26:43 drupal-demonstration.com systemd[1]: httpd.service failed.

Note: apache starts on initial vagrant up build perfectly.

@jeff1evesque
Copy link
Owner Author

We can attempt to implement systemctl edit, with respect to systemd.unit. Specifically, we need to add a mountpoint as a dependency (Requires, After) to httpd.service. This method is different than opening the equivalent service file, since it knows the difference between /etc/systemd, and /usr/lib/systemd, along with how to use drop-ins (.d/).

@jeff1evesque
Copy link
Owner Author

We will attempt to create another systemd service, responsible telling systemd, that the /vagrant/webroot has been mounted. We will run a loop in a shell script as Type=oneshot service. This service will execute before thehttpd service, and be similar to vagrant_mounted.pp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant