#! /bin/sh ARGV="$@" case $ARGV in start) /usr/sbin/httpd -d `pwd` -f conf/apache.conf ruby -C../.. bin/cluster.rb --daemon ruby -C.. simple/app.rb --start # --daemon ERROR=$? ;; restart) # restart appserver only! export ASPID= `ps ax | grep app.rb | grep ruby | cut -d" " -f1` if [ -n "$ASPID" ]; then echo $ASPID kill -9 $ASPID fi ruby -C.. simple/app.rb --restart # --daemon ERROR=$? ;; stop) killall -9 ruby httpd ERROR=$? ;; *) echo "NOP" ERROR=$? esac exit $ERROR