Problems with starting and stopping thin server:

1.2k views Asked by At

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

1

There are 1 answers

1
toobulkeh On

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