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

Fatal errors in starting nginx do not get detected/shown by brew services #215

Closed
alexweissman opened this issue Apr 2, 2020 · 3 comments
Labels

Comments

@alexweissman
Copy link

When I ran brew services start nginx, I would get a message saying that the service had been successfully started. This was also reflected in the output of brew services list. However when I checked my running processes, there was no sign of nginx actually running. Even more baffling, if I ran sudo brew services start nginx, then the nginx process would finally appear.

What I finally realized was that nginx was failing to start because of a permissions issue that only occurred when I tried to start it as an ordinary user. In my case, it was because my nginx logs in /usr/local/var/log/nginx were owned by the root user, and my shell user did not have write access. So, nginx would fail to start.

The problem appears to be that brew is unaware when nginx fails to launch because of a configuration or permissions issue. This is a problem because I need to frequently reload nginx when making changes to configuration files, which often cause errors I need to fix. I would like to see that nginx failed to load (and the error output) when I run brew services restart nginx.

Is this possible?

@MikeMcQuaid
Copy link
Member

I would like to see that nginx failed to load (and the error output) when I run brew services restart nginx.

No, not really, sorry. brew services is a thin wrapper around launchctl and it does not provide that information.

@alexweissman
Copy link
Author

Do you have an alternative suggestion for where this could be implemented, then? It's a real UX issue at the moment.

@MikeMcQuaid
Copy link
Member

We're aware of that. If there was easy solutions: we'd have done them. We'll review PRs to make the situation better.

@lock lock bot added the outdated label May 5, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants