Sha256: 046f5a36aea2abc464dbb1495c1e8ba9b349338eeb59094eaea5045416d6b1f3

Contents?: true

Size: 1.39 KB

Versions: 21

Compression:

Stored size: 1.39 KB

Contents

#!/bin/bash

### BEGIN INIT INFO
# Provides:          unicorn
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts the unicorn web server
# Description:       starts unicorn
### END INIT INFO

USER="deploy"
DAEMON=unicorn
PROJECT_PATH="<%= deploy_to %>"
DAEMON_OPTS="-c $PROJECT_PATH/current/config/unicorn.rb -E production -D"
NAME=unicorn
DESC="Unicorn app for $USER"
PID="$PROJECT_PATH/shared/pids/unicorn.pid"

case "$1" in
  start)
        CD_TO_APP_DIR="cd $PROJECT_PATH/current"
        START_DAEMON_PROCESS="bundle exec $DAEMON $DAEMON_OPTS"

        echo -n "Starting $DESC: "
        if [ `whoami` = 'root' ]; then
          su - $USER -c "$CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS"
        else
          $CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS
        fi
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        kill -QUIT `cat $PID`
        echo "$NAME."
        ;;
  restart)
        echo -n "Restarting $DESC: "
        kill -USR2 `cat $PID`
        echo "$NAME."
        ;;
  reload)
        echo -n "Reloading $DESC configuration: "
        kill -HUP `cat $PID`
        echo "$NAME."
        ;;
  *)
        echo "Usage: $NAME {start|stop|restart|reload}" >&2
        exit 1
        ;;
esac

exit 0

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
pixelforce_cms-2.5 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-2.4 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-2.3 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-2.2 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-2.0 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-1.0 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-0.9.9.9 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-0.9.9.8 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-0.9.9.7 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-0.9.9.6 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-0.9.9.5 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-0.9.9.4 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-0.9.9.3 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-0.9.9.2 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-0.9.9.1 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-0.9.8 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-0.9.7 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-0.9.5 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-0.9.4 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
pixelforce_cms-0.9.2 lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb