Deploy com Capistrano - Command your

1

I'm using capistrano to deploy to 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 attempts to use the SU command in the unicorn_init.sh file. I researched a lot and I can not make progress. Anyone have an idea of a possible solution?

    
asked by anonymous 10.02.2014 / 15:05

2 answers

0

Tent give execute permission to file chmod +x unicorn_init.sh , this can be it.

Or are you running it as root? may be required: sudo ./unicorn_init.sh

    
10.02.2014 / 15:21
0

You can put the user deploying in the sudoers list (via sudo visudo ) so that he can sudo without having to enter the root password, and use sudo instead of su .

Be careful and limit the scope of the script so that it can only execute specific processes like sudo. P.ex:

#/etc/sudoers
deploy ALL=NOPASSWD:/etc/init.d/mysqld, /etc/init.d/apache2
    
10.02.2014 / 15:23