Skip to content

Instantly share code, notes, and snippets.

@kain-jy
Created November 24, 2012 08:21
Show Gist options
  • Save kain-jy/4138864 to your computer and use it in GitHub Desktop.
Save kain-jy/4138864 to your computer and use it in GitHub Desktop.
[rails] init script
#!/bin/sh
BASE=$HOME/app
UNICORN_PID=$BASE/tmp/pids/unicorn.pid
case "$1" in
reload)
echo "reload..."
if [ ! -r $UNICORN_PID ] ; then
echo "no pid file found. maybe is no running."
exit 1
fi
kill -USR2 `cat $UNICORN_PID`
echo "done"
;;
*)
echo "Usage: $0 {reload}"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment