Thin permissions in etc folder (Ubuntu)
Posted
by
Apollo
on Stack Overflow
See other posts from Stack Overflow
or by Apollo
Published on 2012-11-02T13:43:58Z
Indexed on
2012/11/02
17:03 UTC
Read the original article
Hit count: 371
I am working on a RoR server setup that uses Thin and Nginx.
It works fine, but only if I manually add the folder /etc/thin and set the permissions to 777 in order to use the command below:
thin config -C /etc/thin/testapp.yml -c /var/www/testapp --servers 1 -e production
If I don't set it to 777, I get this error:
me@UbuntuRails:/etc$ thin config -C /etc/thin/testapp.yml -c /var/www/testapp --servers 1 -e production
/usr/local/rvm/gems/ruby-1.9.3-p286@rails328/gems/thin-1.5.0/lib/thin/controllers/controller.rb:115:in
initialize': Permission denied - /etc/thin/testapp.yml (Errno::EACCES) from /usr/local/rvm/gems/ruby-1.9.3-p286@rails328/gems/thin-1.5.0/lib/thin/controllers/controller.rb:115:in
open' from /usr/local/rvm/gems/ruby-1.9.3-p286@rails328/gems/thin-1.5.0/lib/thin/controllers/controller.rb:115:inconfig' from /usr/local/rvm/gems/ruby-1.9.3-p286@rails328/gems/thin-1.5.0/lib/thin/runner.rb:187:in
run_command' from /usr/local/rvm/gems/ruby-1.9.3-p286@rails328/gems/thin-1.5.0/lib/thin/runner.rb:152:inrun!' from /usr/local/rvm/gems/ruby-1.9.3-p286@rails328/gems/thin-1.5.0/bin/thin:6:in
' from /usr/local/rvm/gems/ruby-1.9.3-p286@rails328/bin/thin:19:inload' from /usr/local/rvm/gems/ruby-1.9.3-p286@rails328/bin/thin:19:in
' from /usr/local/rvm/gems/ruby-1.9.3-p286@rails328/bin/ruby_noexec_wrapper:14:ineval' from /usr/local/rvm/gems/ruby-1.9.3-p286@rails328/bin/ruby_noexec_wrapper:14:in
'
I don't like to set this folder to a 777, sounds like a rubbish workaround.
I run everything from an admin user account, not root. RVM runs from my admin user and gem only works in my admin as well. If I sudo that action, nothing happens because my root doesn't "know" thin.
Which is the correct way to handle this?
Thanks!
© Stack Overflow or respective owner