i created a celeryd file in /etc/defaults/ from the code here:
https://github.com/celery/celery/blob/3.0/extra/generic-init.d/celeryd
Now when I want to run
Note: in ubuntu 16.04 my anser with the .conf file is not working anymore.
I created a .service file and put this in /etc/systemd/system/
i can use
sudo service myservice status
sudo service myservice start
sudo service myservice stop
as commands
e.g. this file:
myservice.service:
[Unit]
Description=My celery worker
[Service]
WorkingDirectory=/srv/my-project-path
User=buildout
Group=buildout
Restart=on-failure
RestartSec=20 5
ExecStart=/srv/my-project/bin/django celeryd -BE
[Install]
WantedBy=multi-user.target
Alias=myservice.service
note i use buildout, so in setad of bin/django most users need to use the path to python and use mange.py in stead.
base upon: http://minecraft.gamepedia.com/Tutorials/Ubuntu_startup_script (see the with systemd section)