No need for touching restart.txt. A tip for Passenger users
Natham writes about this tip I found today. This one helps to speed up the deployment with Passenger a little bit. In your Capistrano, Vlad, etc, you probably have a step that runs:
touch tmp/restart.txt
This is needed, so Passenger (mod_rails) is able to know when it should restart itself. Now, think about this:
Commit “tmp/restart.txt” to your Git repository.
This way you’ll never have to touch tmp/restart.txt again. This will be deleted when Passenger notices it. And on the next deployment, it’ll be rewritten again, with your deploy script (Capistrano/etc), that probably runs something like “git reset; git pull”, and Passenger will notices again, restart. And so forth.
Clever, isn’t?
Source: A tip for Passenger(mod_rails) users by Nathan.






May 25th, 2011 at 7:18 PM
I don’t think this works with passenger 3 because passenger 3 doesn’t delete tmp/restart.txt. Instead it checks the modified time of the file. “git reset; git pull” won’t update the modified time of the file, so passenger won’t restart.