[Ruby]Passengerのrestart.txtが再起動後削除されないので調べてみた.

Passengerでtmp/restart.txtを作ってやると再起動してrestart.txtが削除されるってどこかに書いてあったと思うけど、再起動後に削除されないので調べてみた.


結果、restart.txtは削除されません.
touchするだけでOK

以下はPassengerのユーザズガイドに書いてました

3.3. Redeploying (restarting the Ruby on Rails application)
3.3. 再配置(Ruby on Railsアプリケーションの再起動)

Deploying a new version of a Ruby on Rails application is as simple as re-uploading the application files, and restarting the application.
Ruby on Railsアプリケーションの新しいバージョンの配置は単純にアプリーケーションファイルの再アップロードとアプリケーションの再起動です.

There are two ways to restart the application:
アプリケーション再起動の方法は二通りある:

1. By restarting Apache.
Apacheを再起動.
2. By creating or modifying the file tmp/restart.txt in the Rails application’s root folder. Phusion Passenger will automatically restart the application.
Railsアプリケーションのルートフォルダ以下にtmp/restart.txtを作成または変更.Phusion Passengerはアプリケーションを自動的に再起動します.

For example, to restart our example MyCook application, we type this in the command line:
例,MyCookアプリケーションを再起動させるためには,以下のコマンドを入力します:

touch /webapps/mycook/tmp/restart.txt

適当に翻訳もしてみた.この再起動の方法2のrestart.txtを作成はまた変更で再起動するとあるけど、再起動後にrestart.txtが削除されるとは書いてない.多分どこかのバージョンで削除しなくなったのだと思う.


それと書かれてないですが、restart.txtファイルの作成後の最初のRailsアプリケーションのアクセス時に再起動するようです.

tmp/restart.txtをSCMにコミットしておいて再起動したいタイミングで書き換えると便利そうだな.