0f3ccb1d14
It is not safe to use Lock and Counter entities in concurrent environment. Change-Id: I22e498c6a85c5b0de9c87d2486afdc7d8cb7c995
36 lines
855 B
Bash
Executable File
36 lines
855 B
Bash
Executable File
#! /bin/sh
|
|
### BEGIN INIT INFO
|
|
# Provides: solar-celery
|
|
# Required-Start: $syslog
|
|
# Required-Stop: $syslog
|
|
# Should-Start: $local_fs
|
|
# Should-Stop: $local_fs
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: 0 1 6
|
|
### END INIT INFO
|
|
|
|
export SOLAR_CONFIG_OVERRIDE=/.solar_config_override
|
|
START="$(/usr/local/bin/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/local/bin/celery multi stopwait 2 --pidfile=/var/run/celery/%N.pid)"
|
|
NAME=solar-celery
|
|
|
|
|
|
case "$1" in
|
|
start)
|
|
"{$START}"
|
|
;;
|
|
stop)
|
|
"{$STOP}"
|
|
;;
|
|
restart|force-reload)
|
|
${0} stop
|
|
${0} start
|
|
;;
|
|
*)
|
|
echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|