Sha256: df85812d0ceedceb3822176bf80c292a4b263240ee40b06ad3cab21c524e0387

Contents?: true

Size: 846 Bytes

Versions: 55

Compression:

Stored size: 846 Bytes

Contents

#!/bin/sh
set -e

APP_ROOT=<%= current_path %>
PID=$APP_ROOT/tmp/pids/sidekiq.pid
CMD="cd $APP_ROOT; RAILS_ENV=<%= "#{fetch(:rails_env)}" %> nohup bundle exec sidekiq -e <%= "#{fetch(:rails_env)}" %> -C <%= current_path %>/config/sidekiq.yml -i 0 -P $PID >> <%= current_path %>/log/sidekiq.log 2>&1 &"
AS_USER="deploy"

run () {
  if [ "$(id -un)" = "$AS_USER" ]; then
    eval $1
  else
    su -c "$1" - $AS_USER
  fi
}

sig () {
  test -s "$PID" && kill -$1 `cat $PID`
}

case "$1" in
  start)
    sig 0 && echo >&2 "Already Running" && exit 0
    run "$CMD"
    ;;
  stop)
    if kill -0 `cat $PID`
    then
        cd $APP_ROOT
        bundle exec sidekiqctl stop $APP_ROOT/tmp/pids/sidekiq.pid 10
        echo "stopping...."
    else
        echo "not running"
    fi
    ;;
  *)
    echo >&2 "Usage: $0 <start|stop>"
    exit 1
    ;;
esac

Version data entries

55 entries across 55 versions & 3 rubygems

Version Path
teleporter-0.0.19 lib/generators/initial/templates/capistrano/shared/sidekiq_init.sh.erb
teleporter-0.0.18 lib/generators/initial/templates/capistrano/shared/sidekiq_init.sh.erb
teleporter-0.0.17 lib/generators/initial/templates/capistrano/shared/sidekiq_init.sh.erb
teleporter-0.0.16 lib/generators/initial/templates/capistrano/shared/sidekiq_init.sh.erb
teleporter-0.0.15 lib/generators/initial/templates/capistrano/shared/sidekiq_init.sh.erb
teleporter-0.0.14 lib/generators/initial/templates/capistrano/shared/sidekiq_init.sh.erb
teleporter-0.0.13 lib/generators/initial/templates/capistrano/shared/sidekiq_init.sh.erb
teleporter-0.0.12 lib/generators/initial/templates/capistrano/shared/sidekiq_init.sh.erb
teleporter-0.0.11 lib/generators/initial/templates/capistrano/shared/sidekiq_init.sh.erb
capistrano-cookbook-0.0.5 lib/capistrano/cookbook/templates/sidekiq_init.sh.erb
capistrano-cookbook-0.0.4 lib/capistrano/cookbook/templates/sidekiq_init.sh.erb
capistrano-cookbook-0.0.3 lib/capistrano/cookbook/templates/sidekiq_init.sh.erb
capistrano-cookbook-0.0.2 lib/capistrano/cookbook/templates/sidekiq_init.sh.erb
capup-0.0.4 lib/capup/templates/sidekiq_init.sh.erb
capup-0.0.2 lib/capup/templates/sidekiq_init.sh.erb