Hello, I''m trying to do a rsync on a folder generated by ruby on Rails. But the main problem is that every generated stuff is nobody nobody. So I''m trying to chown, but the ruby service through apache is not root. So I wonder how can I execute action as a root. Is there any sudo stuff in ruby so I can do my chown on my files an directories, then an rsync. Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi David,> I''m trying to do a rsync on a folder generated by ruby on Rails. > But the main problem is that every generated stuff is nobody nobody. > > So I''m trying to chown, but the ruby service through apache is not root. > > So I wonder how can I execute action as a root. > Is there any sudo stuff in ruby so I can do my chown on my files an > directories, then an rsync.You can execute commands in Ruby using backticks (e.g. `sudo chown`) but I think the truly solution lies in fixing the permissions in the first place. Try to configure the user that the Rails instance runs as. How to do that depends on if you''re using FastCGI, Mongrel or mod_rails. -- Roderick van Domburg http://www.nedforce.nl -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> > You can execute commands in Ruby using backticks (e.g. `sudo chown`) but > I think the truly solution lies in fixing the permissions in the first > place. Try to configure the user that the Rails instance runs as. How to > do that depends on if you''re using FastCGI, Mongrel or mod_rails. >I''ve tried system() but as the process is not root root I can''t change the right to root root. I''m using mod_rails. My rsync is into an action of a controller. How can I set default file creation root root for a virtual host ? I''m not familiar with apache and mod_rails. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
David Nguyen wrote:> I''m using mod_rails. My rsync is into an action of a controller. > > How can I set default file creation root root for a virtual host ? > I''m not familiar with apache and mod_rails.Check out the user switching and default user configuration options in the mod_rails documentation. Reading up on Apache configuration will be required unless you outsource it :-) -- Roderick van Domburg http://www.nedforce.nl -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---