Skip to content

Instantly share code, notes, and snippets.

@drfill
Created June 14, 2012 13:07
Show Gist options
  • Select an option

  • Save drfill/2930192 to your computer and use it in GitHub Desktop.

Select an option

Save drfill/2930192 to your computer and use it in GitHub Desktop.
BSD rc celeryd
#!/bin/sh
# PROVIDE: celery
# REQUIRE: LOGIN
# KEYWORD: shutdown
PATH=$PATH:/usr/local/bin; export PATH
. /etc/rc.subr
name="celery"
rcvar=`set_rcvar`
start_cmd="${name}_start"
stop_cmd="${name}_stop"
celery_user=${celery_user:-"celery"}
celery_group=${celery_group:-"celery"}
celery_cmd=${celery_cmd:-"/usr/local/bin/celeryd"}
celery_logfile=${celery_logfile:-"/var/log/celery/celeryd.log"}
celery_pidfile=${celery_pidfile:-"/var/run/celery/celeryd.pid"}
celery_workdir=${celery_workdir:-"/usr/local/www/baruwa"}
celery_loglevel=${celery_loglevel:-"INFO"}
celery_time_limit=${celery_time_limit:-"300"}
celery_concurrency=${celery_concurrency:-"8"}
load_rc_config $name
celery_start()
{
$celery_workdir/manage.py celeryd_multi start celery --uid=$celery_user --gid=$celery_group --workdir=$celery_workdir --pidfile=$celery_pidfile --logfile=$celery_logfile --loglevel=INFO --c
md=$celery_cmd --time-limit=$celery_time_limit --concurrency=$celery_concurrency
}
celery_stop()
{
$celery_workdir/manage.py celeryd_multi stop celery --pidfile=$celery_pidfile
}
run_rc_command "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment