init script for solar-celery
alternative to docker installation, provides commands for - start - stop - restart (stop/start) Change-Id: Ic996a7aef0265e5c43632e264b63d49397d21ea9
This commit is contained in:
parent
4b1374577a
commit
1001d204fe
37
utils/solar-celery
Executable file
37
utils/solar-celery
Executable file
@ -0,0 +1,37 @@
|
||||
#! /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
|
||||
|
||||
mkdir -p /var/run/celery
|
||||
export SOLAR_CONFIG_OVERRIDE=/.solar_config_override
|
||||
START="$(/usr/local/bin/celery multi start 1 -A solar.orchestration.runner -P gevent -c 1000 -Q system_log,celery,scheduler --pidfile=/var/run/celery/%N.pid --logfile=/var/run/celery/%N.log)"
|
||||
STOP="$(/usr/local/bin/celery multi stopwait 1 --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
|
Loading…
x
Reference in New Issue
Block a user