Fix celery start script

- allow to change config path
- fix bash variables (commands start/stop were always executed)

Change-Id: I0a9a37cf296a2fc88cf4eefd58966206cdeee2b1
This commit is contained in:
Łukasz Oleś 2016-01-21 23:18:53 +01:00
parent 065873ba9e
commit c80a0d401e

View File

@ -9,18 +9,16 @@
# Default-Stop: 0 1 6
### END INIT INFO
export SOLAR_CONFIG_OVERRIDE=/.solar_config_override
START="$(/usr/bin/env celery multi start 2 -A solar.orchestration.runner -P gevent -c:1 1 -c:2 1000 -Q:1 scheduler,system_log -Q:2 celery --pidfile=/var/run/celery/%N.pid --logfile=/var/run/celery/%N.log)"
STOP="$(/usr/bin/env celery multi stopwait 2 --pidfile=/var/run/celery/%N.pid)"
export SOLAR_CONFIG_OVERRIDE=${SOLAR_CONFIG_OVERRIDE:-/.solar_config_override}
NAME=solar-celery
case "$1" in
start)
"{$START}"
/usr/bin/env celery multi start 2 -A solar.orchestration.runner -P gevent -c:1 1 -c:2 1000 -Q:1 scheduler,system_log -Q:2 celery --pidfile=/var/run/celery/%N.pid --logfile=/var/run/celery/%N.log
;;
stop)
"{$STOP}"
/usr/bin/env celery multi stopwait 2 --pidfile=/var/run/celery/%N.pid
;;
restart|force-reload)
${0} stop