Sha256: 8fdf35bde6668d58a5b66bc577fe7a1e78604843213d0814ccde253d3ca3007f

Contents?: true

Size: 952 Bytes

Versions: 7

Compression:

Stored size: 952 Bytes

Contents

#!/bin/bash

USER="deploy"
PROJECT_PATH="<%= deploy_to %>"
NAME=delayed_job
DESC="Delayed Job for $USER"
export RAILS_ENV=production
PID="$PROJECT_PATH/shared/pids/delayed_job.pid"

case "$1" in
  start)
    CD_TO_APP_DIR="cd $PROJECT_PATH/current"
    START_DAEMON_PROCESS="bundle exec ./script/delayed_job -n 1 start"

    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

7 entries across 7 versions & 1 rubygems

Version Path
pixelforce_cms-2.6 lib/generators/pixelforce_cms/templates/recipes/templates/delayed_job_init.erb
pixelforce_cms-2.5 lib/generators/pixelforce_cms/templates/recipes/templates/delayed_job_init.erb
pixelforce_cms-2.4 lib/generators/pixelforce_cms/templates/recipes/templates/delayed_job_init.erb
pixelforce_cms-2.3 lib/generators/pixelforce_cms/templates/recipes/templates/delayed_job_init.erb
pixelforce_cms-2.2 lib/generators/pixelforce_cms/templates/recipes/templates/delayed_job_init.erb
pixelforce_cms-2.0 lib/generators/pixelforce_cms/templates/recipes/templates/delayed_job_init.erb
pixelforce_cms-1.0 lib/generators/pixelforce_cms/templates/recipes/templates/delayed_job_init.erb