capistrano-plugins / capistrano-unicorn-nginx

Capistrano tasks for automatic and sensible unicorn + nginx configuration
MIT License
175 stars 81 forks source link

Error creating symlink #40

Closed Salet closed 9 years ago

Salet commented 9 years ago

I installed the gem and trying to deploy using default settings. However I cannot get past 'cannot create symlink error' during the deploy. As you can see on the screenshot (follow yellow lines):

1

The nginx config file is moved as 'sites-available' file instead inside of a folder. In the result symlink creation fails. Any hints?

bruno- commented 9 years ago

Hi, sorry to hear things break up for you. Did you try creating the /etc/nginx/sites-available/ directory before the deploy? This plugin pretty much presumes that dir exists. That way the file is moved inside\ the directory.

Also, just out of curiosity, what is the deployment server operating system?

Salet commented 9 years ago

Thanks @bruno-, that helps! It's Debian Wheezy. What's interesting is that nginx installed from http://nginx.org/packages/debian/ doesn't create those two directories by default. Maybe the gem should check if they in fact exists?

However, I have two more problems. Later during the deploy Nginx is restarted using

/usr/bin/env sudo /etc/init.d/nginx reload

Which works just fine. Problems are with

/usr/bin/env service unicorn_domnawyjazd.pl_production restart

First thing is that service command is not recognized. It has to be run using 'sudo service' just like nginx or using '/etc/init.d/service_name' way. Is that an environment-specific problem? And the second thing is that /etc/init.d/unicorn_domnawyjazd.pl_production serivce doen't exist - am I supposed to create it manually? Or should unicorn handle that? Sorry for the trouble if it's not gem-related, I'm new to server configurations.

bruno- commented 9 years ago

Hey @Salet, good to hear you've managed to jump the first hurdle.

The core reason for all these issues is that this gem was developed and tested with ubuntu. Due to my inexperience and lack of knowledge I thought things would work smoothly with other distributions. This is obviously not the case. Issues of similar nature have also been reported in #35.

Now onto the specific issues:

Salet commented 9 years ago

Hi @bruno- Thanks for the reply. As for the the lack of service script, I just didn't know I had to run cap setup first. That feature works just fine. Forgive me :)

The service command not working is a real issue however. The PR you mentioned, #37 will most likely work and is the simplest way to solve this. But you should also check last post in #31.

And the original issue I posted, which is lack of sites-enabled directory is also important. Existance of sites-available and sited-enabled is owed to some improvements in nginx for ubuntu package. You should check the last post in #34 to solve this.

Anyway, thanks for the help, I'm closing this as it's just a duplicate now. You are doing great work on the gem, keep it up :)