How can I set Rails user name?

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?

Start your rails server by other user.

On Tue, Mar 3, 2009 at 9:12 AM, 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?

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


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

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 D.
http://destiney.com/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs