mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
parent
a0212490d4
commit
824d78231a
21 changed files with 33 additions and 33 deletions
48
doc/que/que_init_sample
Normal file
48
doc/que/que_init_sample
Normal file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash
|
||||
### BEGIN INIT INFO
|
||||
# Provides: Registry que server
|
||||
# Required-Start: $all
|
||||
# Required-Stop: $network $local_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Enable Registry que server
|
||||
### END INIT INFO
|
||||
|
||||
set -u
|
||||
set -e
|
||||
|
||||
### CHANGES
|
||||
APP_HOME="/home/registry/registry"
|
||||
APP_ROOT="$APP_HOME/current"
|
||||
QUE_USER=registry # or use some other unprivileged OS user what your registry servers uses
|
||||
RAILS_ENV=production
|
||||
RUBY_BUNDLE=/home/$QUE_USER/.rbenv/shims/bundle
|
||||
QUE_INSTANCES=1 # or as many really needed based on real load info
|
||||
### END OF CHANGES
|
||||
|
||||
cd $APP_ROOT || exit 1
|
||||
|
||||
case ${1-help} in
|
||||
status)
|
||||
cd $APP_ROOT && RAILS_ENV=$RAILS_ENV $RUBY_BUNDLE exec lib/daemons/que_ctl status
|
||||
;;
|
||||
start)
|
||||
echo "$1 que monitor and server"
|
||||
for i in `seq 1 $QUE_INSTANCES`; do
|
||||
cd $APP_ROOT && QUE_WORKER_COUNT=1 RAILS_ENV=$RAILS_ENV QUE_USER=$QUE_USER $RUBY_BUNDLE exec rake daemon:que:start
|
||||
echo 'que instance started'
|
||||
done
|
||||
;;
|
||||
stop)
|
||||
echo "$1 que monitor and server"
|
||||
cd $APP_ROOT && RAILS_ENV=$RAILS_ENV $RUBY_BUNDLE exec lib/daemons/que_ctl stop
|
||||
;;
|
||||
restart)
|
||||
echo "$1 que monitor and server"
|
||||
cd $APP_ROOT && RAILS_ENV=$RAILS_ENV QUE_USER=$QUE_USER $RUBY_BUNDLE exec rake daemon:que:restart
|
||||
;;
|
||||
*)
|
||||
echo >&2 "Usage: $0 <status|start|stop|restart>"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue