ok, I've found the solution ...

use sudo instead of run ...

now works perfectly ...

regards,


r.

On 09/04/2009, at 10:32, Raimon Fernandez Sirera wrote:

>
> Hello,
>
>
> How I can copy some config files for my nginx and thin apps ?
>
> I've created a new task, a simple one, that copy both files to their
> place:
>
>
> desc "copy thin and nginx configuration files"
> task :web_copy_config_files do
>   run "cp #{deploy_to}/current/config/nginx.conf /etc/nginx/conf.d/
> #{application}.conf"
>   run "cp #{deploy_to}/current/config/thin.yml /etc/thin/
> #{application}.yml"
> end
>
> MontxMacBookPro:transactions montx$ cap web_copy_config_files
>   * executing `web_copy_config_files'
>   * executing "cp /u/apps/transactions/current/config/nginx.conf /etc/
> nginx/conf.d/transactions.conf"
>     servers: ["transaccions.montx.com"]
> Password:
>     [transaccions.montx.com] executing command
> *** [err :: transaccions.montx.com] cp: cannot create regular file `/
> etc/nginx/conf.d/transactions.conf': Permission denied
>     command finished
> failed: "sh -c \"cp /u/apps/transactions/current/config/nginx.conf /
> etc/nginx/conf.d/transactions.conf\"" on transaccions.montx.com
> MontxMacBookPro:transactions montx$
>
>
>
>
>
> I've tried also with sudo but
>
> desc "copy thin and nginx configuration files"
> task :web_copy_config_files do
>   run "sudo cp #{deploy_to}/current/config/nginx.conf /etc/nginx/
> conf.d/#{application}.conf"
>   run "sudo cp #{deploy_to}/current/config/thin.yml /etc/thin/
> #{application}.yml"
> end
>
>
> but it's not working:
>
>
> MontxMacBookPro:transactions montx$ cap web_copy_config_files
>   * executing `web_copy_config_files'
>   * executing "sudo cp /u/apps/transactions/current/config/
> nginx.conf /etc/nginx/conf.d/transactions.conf"
>     servers: ["transaccions.montx.com"]
> Password:
>     [transaccions.montx.com] executing command
> *** [err :: transaccions.montx.com] [sudo] password for rai:
>
>
> Why cap says the password is wrong, it never asked for it, just once
> for the regular task, and it passed ...
>
> Maybe there's a better way for do this ?
>
> thanks!
>
> r.
>
>
>
>
>
> >
>



--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to