extra_started_commands="reload"
depend() {
- need net
+ need net
use rabbitmq redis logger dns
}
start_workers() {
yesno "${CELERYD_ENABLED}" || return 0
- $CELERYD_MULTI start $CELERYD_NODES $DAEMON_OPTS \
- --pidfile="$CELERYD_PID_FILE" \
- --logfile="$CELERYD_LOG_FILE" \
- --loglevel="$CELERYD_LOG_LEVEL" \
- $CELERYD_OPTS
+ $CELERYD_MULTI start $CELERYD_NODES $DAEMON_OPTS \
+ --pidfile="$CELERYD_PID_FILE" \
+ --logfile="$CELERYD_LOG_FILE" \
+ --loglevel="$CELERYD_LOG_LEVEL" \
+ $CELERYD_OPTS
}
stop_workers() {
# Wait for each node
for node in $CELERYD_NODES; do
- local pidfile=${CELERYD_PID_FILE/\%n/$node}
- local PID=$(cat "${pidfile}" 2>/dev/null)
- while [[ -n "$PID" && "${timeout}" -ge 1 ]] ; do
+ local pidfile=${CELERYD_PID_FILE/\%n/$node}
+ local PID=$(cat "${pidfile}" 2>/dev/null)
+ while [[ -n "$PID" && "${timeout}" -ge 1 ]] ; do
kill -0 $PID 2>/dev/null || break
timeout=$(($timeout - 1))
sleep 0.5
- done
+ done
done
[[ "${timeout}" -lt 1 ]] && return 1
restart_workers() {
yesno "${CELERYD_ENABLED}" || return 0
- $CELERYD_MULTI restart $CELERYD_NODES $DAEMON_OPTS \
- --pidfile="$CELERYD_PID_FILE" \
- --logfile="$CELERYD_LOG_FILE" \
- --loglevel="$CELERYD_LOG_LEVEL" \
- $CELERYD_OPTS
+ $CELERYD_MULTI restart $CELERYD_NODES $DAEMON_OPTS \
+ --pidfile="$CELERYD_PID_FILE" \
+ --logfile="$CELERYD_LOG_FILE" \
+ --loglevel="$CELERYD_LOG_LEVEL" \
+ $CELERYD_OPTS
}
# celerybeat
ebegin "Starting celerybeat"
$CELERYBEAT $CELERYBEAT_OPTS $DAEMON_OPTS --detach \
- --pidfile="$CELERYBEAT_PID_FILE"
+ --pidfile="$CELERYBEAT_PID_FILE"
eend $?
}
checkconfig || return 1
celery_chdir && \
- ${CELERYCTL} status
+ ${CELERYCTL} status
}
<remote-id type="pypi">celery</remote-id>
</upstream>
<use>
- <flag name='redis'>Enables redis support</flag>
+ <flag name="redis">Enables redis support</flag>
<flag name="sqs">Enables Amazon SQS transport module for celery</flag>
<flag name="zeromq">Enable logging and deployment via ZeroMQ</flag>
<flag name="yaml">Enable support of yaml as a configuration file format</flag>