Sha256: 8debcb40e1b7dfaf07d08357d0eb6df0affe367575cbb61988e0931ab89c1508
Contents?: true
Size: 1.24 KB
Versions: 16
Compression:
Stored size: 1.24 KB
Contents
#!/bin/bash export HOME=<%= deploy_to %> export RAILS_ENV=<%= rails_env rescue "production" %> if [[ -e "${HOME}"/.rvm/scripts/rvm ]]; then source "${HOME}"/.rvm/scripts/rvm fi PIDFILE=<%= unicorn_pidfile %> CONFIG=<%= unicorn_config %> CMD="<%= ruby_exec_prefix %> unicorn -c $CONFIG -E $RAILS_ENV -D config.ru" cd <%= current_path %> >/dev/null sig () { test -s "$PIDFILE" && kill -$1 $(<$PIDFILE) } case $1 in start) sig 0 && echo >&2 "Already running" && exit 0 $CMD ;; stop) sig QUIT && exit 0 echo >&2 "Not running" ;; kill) sig TERM && exit 0 echo >&2 "Not running" ;; reload) sig HUP && echo reloaded OK && exit 0 echo >&2 "Couldn't reload, starting '$CMD' instead" $CMD ;; upgrade) sig USR2 && exit 0 echo >&2 "Couldn't upgrade, starting '$CMD' instead" $CMD ;; addworker) sig TTIN && echo added one worker to the pool OK && exit 0 echo >&2 "Couldn't add worker" && exit 1 ;; delworker) sig TTOU && echo removed one worker from the pool OK && exit 0 echo >&2 "Couldn't remove worker" && exit 1 ;; logrotate) sig USR1 && echo rotated logs OK && exit 0 echo >&2 "Couldn't rotate logs" && exit 1 ;; *) echo >&2 "Usage: $0 <start|stop|kill|reload|upgrade|addworker|delworker|logrotate>" exit 1 ;; esac
Version data entries
16 entries across 16 versions & 1 rubygems