0

I am using thin server for my Rails app in production. I am using thin with init.d and so using an rvm wrapper. Following are the steps I followed:

root@:~# rvm gemset create ruby2
gemset created ruby2    => /usr/local/rvm/gems/ruby-2.0.0-p195@ruby2
root@:~# rvm alias create ruby2 ruby-2.0.0-p195@ruby2
Creating alias my_app for ruby-2.0.0-p195@ruby2.
Recording alias my_app for ruby-2.0.0-p195@ruby2.
root@:~# rvm wrapper ruby2 bootup thin
Saving wrappers to '/usr/local/rvm/bin'.

I then created a config file for thin under /etc/thin as follows:

---
require: []

log: log/thin.log
max_conns: 1024
pid: tmp/pids/thin.pid
wait: 30
timeout: 30
address: 0.0.0.0
max_persistent_conns: 100
chdir: /root/app1/app
environment: production
port: 3000
daemonize: true

/etc/init.d/thin has configs as followS:
DAEMON=/usr/local/rvm/bin/bootup_thin
SCRIPT_NAME=/etc/init.d/thin
CONFIG_PATH=/etc/thin

The actual problem I am having is that when I start the process for thin using /etc/init.d/thin start, I don't see any process even though the command completes without error. When I stop it (/etc/init.d/thin stop) I get

    /usr/local/rvm/gems/ruby-2.0.0-p195@ruby2/gems/thin-1.6.1/lib 
    /thin/daemonizing.rb:129:in `send_signal': Can't stop process, no PID found in tmp/pids  
/thin.pid (Thin::PidFileNotFound)

Any ideas?

Thanks

mpapis
  • 52,729
  • 14
  • 121
  • 158
H P
  • 113
  • 3
  • 13
  • Have you tried this solution? http://stackoverflow.com/questions/17023758/ruby-no-pid-found-in-tmp-pids-thin-pid-thinpidfilenotfound or any of these solutions? https://www.google.co.uk/search?q=send_signal%27:+Can%27t+stop+process,+no+PID+found+in+tmp&ie=utf-8&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb&gws_rd=cr&ei=YwqlUrGHEtGShQeY4oHgCA – Shaun Frost Duke Jackson Dec 09 '13 at 00:11
  • Can you post your /etc/init.d script file? – toobulkeh Dec 09 '13 at 01:15
  • I did various things like restarting my machine, doing bundle install and changing permissions and not sure which one worked but now its working. But I still have another question from my original post.. I created a wrapper like rvm wrapper ruby2 bootup thin as given in some example online but when I did standalone command bootup thin, it gave an error. But now that everything is working, are there any other precautions I might need to take especially with the wrapper command? Sorry, this is my first time working on a rails app myself – H P Dec 09 '13 at 01:30

1 Answers1

0

My first assumption would be to make the /etc/thin config locations contain full paths instead of relative ones. /log/thin.log instead of log/thin.log

toobulkeh
  • 1,618
  • 1
  • 14
  • 22
  • I don't think it matters because you are specifying the variable chdir: /root/raagas_app1/raagas_app – H P Dec 09 '13 at 01:31