Commit 2d5c2259082bf751896dc2b8c8380788491faf40
Exists in
master
and in
17 other branches
Merge pull request #72 from colab/celery_service
Colab, celeryd and celerybeat services
Showing
3 changed files
with
27 additions
and
2 deletions
Show diff stats
| @@ -0,0 +1,12 @@ | @@ -0,0 +1,12 @@ | ||
| 1 | +[Unit] | ||
| 2 | +Description=Celery beat | ||
| 3 | +PartOf=colab.service | ||
| 4 | + | ||
| 5 | +[Service] | ||
| 6 | +User=colab | ||
| 7 | +ExecStartPre=/usr/bin/install -d -m 0700 -o colab /var/run/colab | ||
| 8 | +ExecStart=/usr/lib/colab/bin/colab-admin celery beat --pidfile=/var/run/colab/celerybeat.pid --schedule=/var/lib/colab/celery/celereybeat-schedule | ||
| 9 | +Restart=on-failure | ||
| 10 | + | ||
| 11 | +[Install] | ||
| 12 | +WantedBy=multi-user.target |
| @@ -0,0 +1,12 @@ | @@ -0,0 +1,12 @@ | ||
| 1 | +[Unit] | ||
| 2 | +Description=Celery worker | ||
| 3 | +PartOf=colab.service | ||
| 4 | + | ||
| 5 | +[Service] | ||
| 6 | +EnvironmentFile=-/etc/default/celeryd | ||
| 7 | +User=colab | ||
| 8 | +ExecStart=/usr/lib/colab/bin/colab-admin celery worker $CELERYD_OPTS | ||
| 9 | +Restart=on-failure | ||
| 10 | + | ||
| 11 | +[Install] | ||
| 12 | +WantedBy=multi-user.target |
misc/lib/systemd/system/colab.service
| 1 | [Unit] | 1 | [Unit] |
| 2 | Description=Colab | 2 | Description=Colab |
| 3 | +Before=celeryd.service celerybeat.service | ||
| 4 | +Requires=celeryd.service celerybeat.service | ||
| 3 | 5 | ||
| 4 | [Service] | 6 | [Service] |
| 5 | User=colab | 7 | User=colab |
| 6 | EnvironmentFile=-/etc/sysconfig/colab | 8 | EnvironmentFile=-/etc/sysconfig/colab |
| 7 | PermissionsStartOnly=true | 9 | PermissionsStartOnly=true |
| 8 | -ExecStartPre=/usr/bin/mkdir -p /var/lock/colab | ||
| 9 | -ExecStartPre=/usr/bin/chown -R colab:colab /var/lock/colab | 10 | +ExecStartPre=/usr/bin/install -d -m 0750 -o colab -g colab /var/lock/colab |
| 10 | ExecStart=/usr/lib/colab/bin/gunicorn colab.wsgi:application --config=/etc/colab/gunicorn.py | 11 | ExecStart=/usr/lib/colab/bin/gunicorn colab.wsgi:application --config=/etc/colab/gunicorn.py |
| 11 | Restart=on-failure | 12 | Restart=on-failure |
| 12 | 13 |