Bourne shell script at /etc/init.d to start or stop Celery worker accomodated in a Python virtualenv.
- 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
- 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
- with Debian insserv
$ sudo /etc/init.d/celery_workman install
- to disable
$ sudo /etc/init.d/celery_workman uninstall
- 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"
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.
- configure() return list of celery management command
- check sample/app/workers.py