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

Requires a reboot after most actions #797

Closed
mishterk opened this issue Jul 15, 2019 · 3 comments
Closed

Requires a reboot after most actions #797

mishterk opened this issue Jul 15, 2019 · 3 comments

Comments

@mishterk
Copy link

Howdy,

I've recently run into some issues where I now have to reboot my machine whenever I:

  1. Run valet secure or valet unsecure
  2. Run valet use php@xx

Whenever I do a reboot, I also need to run mysql.server start.

I recently completely reinstalled Valet using this approach – #326 (comment).

Some possibly helpful info:

image

To demonstrate

Here are the php, dnsmasq, and nginx processes before changing anything:

image

I then run valet unsecure and the same processes change to:

image

Checking config – looks ok...

image

From there I attempt to run NGINX again:

image

I check port 80:

image

This is where I'm not sure what to do next and go for the reboot after which everything works fine again.

Can anyone give me some direction on what I need to do here to get Valet running smoothly again? I'm guessing there is an issue with daemons and that's possibly related to permissions but I'm pushing the boundaries of what I'm used to here.

Thanks!
Phil

@drbyte
Copy link
Contributor

drbyte commented Jul 15, 2019

The primary difference between yours and mine is that you've installed Apache, and it's sitting there running as root. And it appears to be listening on port 80.
Nginx won't be able to bind itself to listen on ports 80 or 443 if Apache is already sitting there listening for incoming traffic on those ports.

I suppose the quick test is:
sudo brew services stop httpd
And then valet restart

@mishterk
Copy link
Author

Thanks, @drbyte.

I'm halfway there 🎉

I wasn't able to stop apache using sudo brew services stop httpd. It was listed as stopped in brew services list after running the command but was still running on port 80 – guessing it was OSX's built-in Apache that was running. sudo apachectl stop wouldn't work for me either so to stop it I had to use sudo /usr/sbin/apachectl stop:

Screen Shot 2019-07-15 at 12 59 44 pm

From there, a valet restart resulted in NGINX running again:

Screen Shot 2019-07-15 at 1 00 01 pm

The only thing that I still need to do after a reboot is mysql.server start. It's not a huge issue but if anyone has an idea on how I get Valet's daemon handling this again that would be rad.

@drbyte
Copy link
Contributor

drbyte commented Jul 15, 2019

Valet doesn't have anything to do with MySQL. It's entirely optional and completely under your sole control.

(Given you've installed it with Homebrew), the best way to have it self-start upon reboot is to follow Homebrew's instructions (get them with brew info mysql) for telling it to start upon boot:

To have launchd start mysql now and restart at login:
  brew services start mysql
Or, if you don't want/need a background service you can just run:
  mysql.server start

If that doesn't work, then I suggest looking at your MySQL logs or your OSX Console for why it's stopping/not-starting.

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

No branches or pull requests

2 participants