也許你已經看到了這個...如何告訴獨角獸瞭解Heroku的信號?
2012-03-07T15:36:25+00:00 heroku[web.1]: Stopping process with SIGTERM 2012-03-07T15:36:36+00:00 heroku[web.1]: Stopping process with SIGKILL 2012-03-07T15:36:36+00:00 heroku[web.1]: Error R12 (Exit timeout) -> Process failed to exit within 10 seconds of SIGTERM 2012-03-07T15:36:38+00:00 heroku[web.1]: Process exited with status 137
本上運行herokuunicorn時是一個衆所周知的問題...
燦我告訴heroku發送SIGQUIT
?或者我可以告訴獨角獸將SIGTERM
視爲優雅關機?
我didin't知道,我正在考慮麒麟的一個項目,但是這讓我。重新考慮。以下是精簡使用的信號:https://github.com/macournoyer/thin/blob/master/lib/thin/server.rb#L211在這兩種情況下,QUIT表示正常關機,但INT和TERM交換。 – 2012-03-12 18:56:19
順便說一句,這裏還有另一個因素 - heroku會將TERM發送到Procfile中定義的進程,但是該進程負責將信號按照它認爲合適的方式向下傳遞。因此,如果您在bundle exec後面運行服務器,即使heroku發送正確的信號,您也會看到上面的行爲,因爲Web服務器根本沒有得到信號。我已經談到支持這個,他們正在提出一個解決方案。 – 2012-03-12 18:58:20
我今天發現這個,我還沒有探索它:https://github.com/ddollar/foreman/wiki/Custom-Signals – 2012-03-15 06:02:34