On Mon, Mar 2, 2009 at 7:12 PM, Zhao Yi
<[email protected]> wrote:
>
> I use root to start the Rails server. So all the operations on this
> server will be root permission. For example, create a file in the server
> disk. How can I change a user?

Perhaps something like this:

#!/bin/sh

cd /path/to/rails

if [ `/usr/bin/whoami` = 'root' ]; then
    /bin/su -c "/usr/local/bin/mongrel_rails start -e production -p
6001 -d" rails_user
else
    /usr/local/bin/mongrel_rails start -e production -p 6001 -d
fi



-- 
Greg Donald
http://destiney.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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to