Следующие инструкции были найдены here, я скопировал the script from github в /etc/init.d/celeryd, а затем сделал его исполняемым;Daemonizing celery
$ ll /etc/init.d/celeryd
-rwxr-xr-x 1 root root 9481 Feb 19 11:27 /etc/init.d/celeryd*
Я создал конфигурационный файл /и т.д./по умолчанию/celeryd в соответствии с инструкциями:
# Names of nodes to start
# most will only start one node:
#CELERYD_NODES="worker1"
# but you can also start multiple and configure settings
# for each in CELERYD_OPTS (see `celery multi --help` for examples).
CELERYD_NODES="worker1 worker2 worker3"
# Absolute or relative path to the 'celery' command:
CELERY_BIN="/usr/local/bin/celery"
#CELERY_BIN="/virtualenvs/def/bin/celery"
# App instance to use
# comment out this line if you don't use an app
#CELERY_APP="proj"
# or fully qualified:
#CELERY_APP="proj.tasks:app"
# Where to chdir at start.
CELERYD_CHDIR="/path/to/folder/containing/tasks/"
# Extra command-line arguments to the worker
CELERYD_OPTS="--time-limit=3000 --concurrency=3 --config=celeryconfig"
# %N will be replaced with the first part of the nodename.
CELERYD_LOG_FILE="/var/log/celery/%N.log"
CELERYD_PID_FILE="/var/run/celery/%N.pid"
# Workers should run as an unprivileged user.
# You need to create this user manually (or you can choose
# a user/group combination that already exists, e.g. nobody).
CELERYD_USER="celery"
CELERYD_GROUP="celery"
# If enabled pid and log directories will be created if missing,
# and owned by the userid/group configured.
CELERY_CREATE_DIRS=1
Примечание: Я добавил --config = celeryconfig часть в CELERYD_OPTS.
Я создал новый пользователь сельдерей с
sudo useradd -N -M --system -s /bin/false celery
, а затем создал группу сельдерей и добавил пользователя к нему:
$ id celery
uid=999(celery) gid=1005(celery) groups=1005(celery)
Я использовал CHOWN сельдерей: сельдерей для папок:
/var/run/сельдерей/
/вар/Журнал/сельдерей/
При попытке запустить службу, я не получаю никаких указаний на ошибки:
$ sudo service celeryd start
celery init v10.0.
Using config script: /etc/default/celeryd
но статус дает мне «нет ИДП не были найдены»:
$ sudo service celeryd status
celery init v10.0.
Using config script: /etc/default/celeryd
celeryd is stopped: no pids were found
и в самом деле, пс -ef не дает никаких результатов и не PID файл или файлы журналов создаются:
$ ll /var/run/celery
total 0
drwxr-sr-x 2 celery celery 40 Feb 19 14:13 ./
drwxr-xr-x 16 root root 620 Feb 19 12:35 ../
$ ll /var/log/celery
total 8
drwxr-sr-x 2 celery celery 4096 Feb 19 14:13 ./
drwxr-xr-x 13 root root 4096 Feb 19 11:37 ../
Дополнительная информация:
$ pip freeze | grep celery
celery==3.1.9
Что мне не хватает? Где я должен искать дополнительные подсказки относительно того, почему сельдерей не начинается?
Для тех, кто ищет кормушку для обработки демонизации сельдерея проверить это http://aameer.github.io/circus-as-an-alternative-to-supervisor/ – Aameer
Есть ли причина, почему ты используется -N с useradd? "-N --no-user-group Не создавать группу с тем же именем, что и пользователь". Когда вы тогда «создали сельдерей группы и добавили к нему пользователя». Я действительно не знаю, эквивалентны ли они. –