
- allow to change config path - fix bash variables (commands start/stop were always executed) Change-Id: I0a9a37cf296a2fc88cf4eefd58966206cdeee2b1
34 lines
835 B
Bash
Executable File
34 lines
835 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:-/.solar_config_override}
|
|
NAME=solar-celery
|
|
|
|
|
|
case "$1" in
|
|
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
|
|
;;
|
|
restart|force-reload)
|
|
${0} stop
|
|
${0} start
|
|
;;
|
|
*)
|
|
echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|