Skip to content

harajuku-tech/celery_workman

Repository files navigation

celery_workman

Bourne shell script at /etc/init.d to start or stop Celery worker accomodated in a Python virtualenv.

Install

  • install celery_workman to your virualenv
$ pip install -e git+https://github.com/harajuku-tech/celery_workman.git#egg=celery_workman

Python daemonizing script is installed on $VIRTUALENV/bin

(tact)hdknr@wzy:~$ which celery_workman.py

/home/hdknr/ve/tact/bin/celery_workman.py

copy bourne shell scirpt

  • or symlink
$ sudo cp sample/etc/init.d/celery-workman.sh to /etc/init.d/celery-workman
$ sudo chomod +x  /etc/init.d/celery-workman

Enable start on bool

  • with Debian insserv
$  sudo /etc/init.d/celery_workman install
  • to disable
$  sudo /etc/init.d/celery_workman uninstall

Configure /etc/init.d/celery-workman

  • Add your Django projects in a virtualenv which is the same one as the daemonizing Python script in on.
DJANGO_SAMPLE=/home/hdknr/ve/tact/src/celery-workman/sample/app
DJANGO_FOO=/home/hdknr/ve/tact/src/hoge/app
DJANGO_BAR=/home/hdknr/ve/tact/src/hoge/app
  • Specify auto starting on OS boot:
ONSTART="SAMPLE FOO"

Start and Stop manually

Syntax:

$ sudo /etc/init.d/celery_workman  {{command}} {{project_symbol}}
  • Starting
$ sudo /etc/init.d/celery_workman start SAMPLE
  • Stopping
$ sudo /etc/init.d/celery_workman stop SAMPLE
  • Command are configured in workers.py of your each django project.

Workers.py

Releases

No releases published

Packages

No packages published