Sha256: 205ad7f5af732306681c485a3e32883e6f0859bd66403edc9c6b1a71d3884d18

Contents?: true

Size: 1.8 KB

Versions: 19

Compression:

Stored size: 1.8 KB

Contents

#! /bin/bash
 
### BEGIN INIT INFO
# Provides:          delayed job
# 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 delayed job service
# Description:       starts delayed job
### END INIT INFO
 
USER="deploy"
DAEMON=sphinx
PROJECT_PATH="<%= deploy_to %>/current"
DESC="Sphinx job app for $USER"

export RAILS_ENV=production
CD_TO_APP_DIR="cd $PROJECT_PATH"
case "$1" in
  start)
        echo -n "Starting $DESC: "
        if [ `whoami` = root ]; then
          su - $USER -c "$CD_TO_APP_DIR > /dev/null 2>&1 && bundle exec rake ts:start"
        else
          $CD_TO_APP_DIR > /dev/null 2>&1 && bundle exec rake ts:start
        fi
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        if [ `whoami` = root ]; then
          su - $USER -c "$CD_TO_APP_DIR > /dev/null 2>&1 && bundle exec rake ts:stop"
        else
          $CD_TO_APP_DIR > /dev/null 2>&1 && bundle exec rake ts:stop
        fi
        echo "$NAME."
        ;;
  restart)
        echo -n "Restarting $DESC: "
        if [ `whoami` = root ]; then
          su - $USER -c "$CD_TO_APP_DIR > /dev/null 2>&1 && bundle exec rake ts:restart"
        else
          $CD_TO_APP_DIR > /dev/null 2>&1 && bundle exec rake ts:restart
        fi
        echo "$NAME."
        ;;
  reindex)
        echo -n "Reloading $DESC configuration: "
        if [ `whoami` = root ]; then
          su - $USER -c "$CD_TO_APP_DIR > /dev/null 2>&1 && bundle exec rake ts:index"
        else
          $CD_TO_APP_DIR > /dev/null 2>&1 && bundle exec rake ts:index
        fi
        echo "$NAME."
        ;;
  *)
        echo "Usage: $NAME {start|stop|restart|reindex}" >&2
        exit 1
        ;;
esac
 
exit 0

Version data entries

19 entries across 19 versions & 1 rubygems

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