Tuesday, November 21, 2006

Restarting WEBrick using script

#!/bin/sh
pid=$(ps -o pid,command | grep '\' | awk '{print $1}')
kill -9 $pid
ruby script/server

This script restarts the Webrick cleanly (doing CTRL+c does not seem to shutdown the server)

Save it in a file, restart.sh. Do a chmod +x restart.sh and type the command: sh restart.sh to run it.

No comments:

Post a Comment