Sha256: 42062f43fb5a00ee2e2448dce026679e9d770bf102f7c1994c5c15b4d5ffecfd

Contents?: true

Size: 752 Bytes

Versions: 2

Compression:

Stored size: 752 Bytes

Contents

#!/bin/sh
#
# chkconfig: - 85 15
# description: <%= @app_name %>

. /etc/rc.d/init.d/functions

RAILS_USER=<%= ENV['USER'] %>
RAILS_ENV=<%= @rails_env %>
RAILS_ROOT=<%= @rails_root %>

PID=${RAILS_ROOT}/tmp/pids/unicorn.pid
CONFIG=${RAILS_ROOT}/config/unicorn.rb

export PATH="${PATH}":/usr/local/bin

start() {
  echo -n 'Starting <%= @app_name %>: '
  daemon --user=${RAILS_USER} --pidfile=$PID bundle exec unicorn_rails -c ${CONFIG} -E ${RAILS_ENV} -D
  echo
}

stop() {
  echo -n 'Stopping <%= @app_name %>: '
  killproc -p ${PID} -QUIT
  echo
}

cd ${RAILS_ROOT} || exit 1

case $1 in

  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    start
    ;;
  *)
    echo >&2 "Usage: $0 <start|stop|restart>"
    exit 1
    ;;
esac

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
daddy-0.5.16 itamae/cookbooks/unicorn/templates/init.d/app.erb
daddy-0.5.15 itamae/cookbooks/unicorn/templates/init.d/app.erb