Deploy with Capistrano - Comando su

Asked

Viewed 118 times

1

I’m using Capistrano to deploy on Amazon.

Capistrano + Unicorn + Nginx + Ec2

When I go to deploy:Cold, it gives the following error:

 servers: ["ec2-xx-xxx-xx-xx.sa-east-1.compute.amazonaws.com"]
[ec2-xx-xxx-xx-xx.sa-east-1.compute.amazonaws.com] executing command
[err :: ec2-xx-xxx-xx-xx.sa-east-1.compute.amazonaws.com] su: must be run from a terminal
failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '2.1.0' -c '/etc/init.d/unicorn_app      start'" on ec2-xx-xxx-xx-xx.sa-east-1.compute.amazonaws.com

The problem is that it tries to use the SU command in the unicorn_init.sh file. I’ve done a lot of research and I can’t make progress. Does anyone have an idea of a possible solution?

  • what Gems is using for Capistrane? In case you are following a tutorial it would also help to know which one.

2 answers

0


Try to give permission to execute the file chmod +x unicorn_init.sh, could be that.

Or else, are you running it as "root"? may be accurate: sudo ./unicorn_init.sh

  • Fábio, there is no way because everything is done by Capistrano. He sends the necessary files to the server.

0

You can put the user who deploys to the list of sudoers (via sudo visudo) so that he can do sudo without needing the root password to be typed, and to use sudo instead of su.

Take care and limit the scope of the script so that it can only perform specific processes like sudo. P.ex:

#/etc/sudoers
deploy ALL=NOPASSWD:/etc/init.d/mysqld, /etc/init.d/apache2
  • Rodrigo, I tried this way and nothing. My user already had sudo permission. This SU is inside unicorn_init.sh. I tried to move there to sudo and gave error. I think he needs this SU itself. I do not understand much of this Unicorn config.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.