How can I set Rails user name?


#1

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?


#2

Start your rails server by other user.

On Tue, Mar 3, 2009 at 9:12 AM, Zhao Yi
removed_email_address@domain.invalidwrote:

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?

Posted via http://www.ruby-forum.com/.


Only two surfaces of a box:
http://blog.pixnet.net/zusocfc


#3

On Mon, Mar 2, 2009 at 7:12 PM, Zhao Yi
removed_email_address@domain.invalid 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 D.
http://destiney.com/