Restarting a Rails Server

1

1

What exactly does this command do, in regards to running a Rails server?

~$ sudo touch restart.txt

I thought it restarts the Rails server, but it happens so fast when I run it, that I can hardly believe it's really rebooting the Rails server. It's fixed my problem a bunch of times, but I would like to know why it works, and what it's doing.

Thanks!

Goldentoa11

Posted 2012-05-10T17:01:58.937

Reputation: 123

Answers

5

If you are using Passenger, then it's monitoring the timestamp of the tmp/restart.txt file to trigger restarts.

kweerious

Posted 2012-05-10T17:01:58.937

Reputation: 356

1ahh, so passenger is looking at it and when it sees a newer timestamp, it knows to restart itself? – Goldentoa11 – 2012-05-11T18:58:49.257

1@Goldentoa11 yes. – whitequark – 2012-05-11T19:04:44.847