Ruby - no PID found in tmp/pids/thin.pid (Thin::PidFileNotFound)

随声附和 提交于 2019-12-23 16:25:17

问题


I'm trying to start thin for my app but then the pid cannot be generated:

$ thin -C /var/www/project_path/current/config/myproject.testing.yml start

Now I can't stop it because there is no pid:

 $ thin -C /var/www/project_path/current/config/myproject.testing.yml stop

   /home/usr/.rvm/gems/ruby-1.9.2-p180@api/gems/thin-1.5.1/lib/thin/daemonizing.rb:131:in `send_signal': Can't stop process, no PID found in tmp/pids/thin.pid (Thin::PidFileNotFound)

This is the yml file:

pid: /home/usr/htdocs/testing/myproject/shared/pids/thin.pid
rackup: config.ru
log: /home/usr/htdocs/testing/myproject/shared/log/thin.log
timeout: 30
port: 1234
max_conns: 1024
chdir: /home/usr/htdocs/testing/myproject/current
max_persistent_conns: 128
environment: testing
address: 127.0.0.1
require: []

daemonize: true

update:

Now I can start the server but after some seconds process vanish automatically; means I can't see the pid which was generated by starting the server after some seconds.


回答1:


lsof -wni tcp:1234

will give you the process ID

kill -9 PID

will kill the process




回答2:


I had exactly the same annoying problem

I've found that if the server crashes on startup, the pid file gets created but there is no pid in the file. Try cat'ing the log file for the server ./logs/thin.3001.log and look for errors. You could also try starting the server manually via

rails s -p 3000

and see if there are any errors thrown.

Good luck

Chris



来源:https://stackoverflow.com/questions/17023758/ruby-no-pid-found-in-tmp-pids-thin-pid-thinpidfilenotfound

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!