Inicia o daemon de aipo via systemd

4

No /usr/lib/systemd/system/celery.service:

[Unit]
Description=Celery Nodes Daemon
After=network.target

[Service]
Type=forking
PIDFile=/var/run/celery/main.pid
ExecStart=/usr/bin/python2 /home/myuser/path/to/Django/myproject/manage.py celeryd_multi start w1 --pidfile="/var/run/celery/%n.pid" --logfile="/var/log/celery/%n.log" --cmd="-m celery.bin.celeryd_detach"
ExecStop=/usr/bin/python2 /home/myuser/path/to/Django/myproject/manage.py celeryd_multi stopwait w1 --pidfile="/var/run/celery/%n.pid"

[Install]
WantedBy=multi-user.target

No shell:

$ sudo systemctl enable celery.service
ln -s '/usr/lib/systemd/system/celery.service' '/etc/systemd/system/multi-user.target.wants/celery.service'
$ sudo systemctl start celery.service
Job for celery.service failed. See 'systemctl status celery.service' and 'journalctl -xn' for details.
$ sudo systemctl status celery.service
celery.service - Celery Nodes Daemon
  Loaded: loaded (/usr/lib/systemd/system/celery.service; enabled)
  Active: failed (Result: exit-code) since Пт 2013-03-29 13:22:24 NOVT; 38s ago
  Process: 32273 ExecStart=/usr/bin/python2 /home/anarchist/Desktop/Develop/Django/myproject/manage.py celeryd_multi start w1 --pidfile="/var/run/celery/%n.pid" --logfile="/var/log/celery/%n.log" --cmd="-m celery.bin.celeryd_detach" (code=exited, status=1/FAILURE)

No journalctl -xn nada sobre aipo. Como iniciar o daemon de aipo via systemd?

    
por Max 29.03.2013 / 07:43

1 resposta

2

Depois de um monte de experiências, eu criei esta configuração para o serviço (modificado para corresponder ao seu exemplo):

[Unit]
Description=Celery Server
After=network.target

[Service]
Type=oneshot
KillMode=control-group
RemainAfterExit=yes
Restart=no
ExecStart=/usr/bin/python2 /home/myuser/path/to/Django/myproject/manage.py celeryd_multi start w1 --pidfile="/tmp/%n.pid" --logfile="/var/log/celery/%n.log" --loglevel=INFO --time-limit=300
ExecStop=/usr/bin/python2 /home/myuser/path/to/Django/myproject/manage.py celeryd_multi stopwait w1 --pidfile="/tmp/%n.pid"

[Install]
WantedBy=multi-user.target
    
por 17.04.2013 / 10:26