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

How to stop and start unicorn from cli without breaking the unix:socket #365

Open
alexissavin opened this issue Jan 15, 2016 · 0 comments
Open

Comments

@alexissavin
Copy link

Hi,

I'm trying to find a way to stop and start unicorn from the cli on the deployed rails-app servers.

Unfortunately, each time I do so, nginx loose access to the socket (/srv/www//shared/sockets/unicorn.sock).

Apparently SeLinux is preventing nginx to access the socket. But running restorecon doesn't fix the issue. Each time I have to remove the "sockets" directory and run once again the deploy cookbook.

ls -Z display the following result :
Before Stop Unicorn : srwxrwxrwx. deploy nginx system_u:object_r:httpd_var_run_t:s0 unicorn.sock
After Stop and Start : srwxrwxrwx. deploy nginx unconfined_u:object_r:httpd_var_run_t:s0 unicorn.sock
After Restorecon -rv : srwxrwxrwx. deploy nginx unconfined_u:object_r:httpd_var_run_t:s0 unicorn.sock
After Restorecon -F -rv : srwxrwxrwx. deploy nginx system_u:object_r:httpd_var_run_t:s0 unicorn.sock

To start/stop unicorn I use the following command : "cd /srv/www//current && ../../shared/scripts/unicorn clean-restart" as user deploy.

Is there a proper way to stop and then restart unicorn that I'm missing ?

Thanks for your feedback.

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

1 participant