简体   繁体   中英

Starting rqworker using supervisor causes spawn error

Trying to start rqworker as stated in its README using this command:

python manage.py rqworker default

For some reason it gives ERROR (spawn error) and status shows FATAL Exited too quickly (process log may have details) . Logs has no any information for error ( exit status 1; not expected ).

My supervisor configuration:

[program:rqworker]
user=ubuntu
directory=/var/www/project/
command=/var/www/project/venv/bin/python manage.py rqworker default > /var/log/project/rq.log
stopsignal=TERM
autorestart=true
autostart=true
numprocs=1

Running command directly from ubuntu user works as expected.

I submitted a PR on how to set this up on Ubuntu which may help you.

https://github.com/W7PEA/django-rq/blob/4afc19ab9866882c1809f89f84066856c94d75c6/README.rst

Deploying on Ubuntu Create an rqworker service that runs the high, default, and low queues.

sudo vi /etc/systemd/system/rqworker.service

[Unit]
Description=Django-RQ Worker
After=network.target

[Service]
WorkingDirectory=<<path_to_your_project_folder>>
ExecStart=/home/ubuntu/.virtualenv/<<your_virtualenv>>/bin/python \
    <<path_to_your_project_folder>>/manage.py \
    rqworker high default low

[Install]
WantedBy=multi-user.target

Enable and start the sevice

sudo systemctl enbable rqworker
sudo systemctl start rqworker

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM