[systemd-devel] Is this list still active? Where can I get basic help with systemd
Doug Snyder
webcoach101 at gmail.com
Tue Dec 5 19:19:43 UTC 2017
Well, it runs fine by itself using the exact same command on the command
line.
Its when systemd is added to the mix that the problems occur
The people that put out celery have docs on how to use it with systemd, its
just that they don't work:
http://docs.celeryproject.org/en/latest/userguide/daemonizing.html
I based my service off theirs but the Type=forking was copied right from
theirs
Maybe if I use their version more exactly it might work.
But their version doesn't work at all ssince I suspect they are using
templating
( I copied the %I from their file )
They reference config variables in their template:
/etc/systemd/system/celery.service:
[Unit]Description=Celery ServiceAfter=network.target
[Service]Type=forkingUser=celeryGroup=celeryEnvironmentFile=-/etc/conf.d/celeryWorkingDirectory=/opt/celeryExecStart=/bin/sh
-c '${CELERY_BIN} multi start ${CELERYD_NODES} \ -A ${CELERY_APP}
--pidfile=${CELERYD_PID_FILE} \ --logfile=${CELERYD_LOG_FILE}
--loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'ExecStop=/bin/sh -c
'${CELERY_BIN} multi stopwait ${CELERYD_NODES} \
--pidfile=${CELERYD_PID_FILE}'ExecReload=/bin/sh -c '${CELERY_BIN}
multi restart ${CELERYD_NODES} \ -A ${CELERY_APP}
--pidfile=${CELERYD_PID_FILE} \ --logfile=${CELERYD_LOG_FILE}
--loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
[Install]WantedBy=multi-user.target
/etc/default/celeryd:
# Names of nodes to start# most people will only start one
node:CELERYD_NODES="worker1"# but you can also start multiple and
configure settings# for each in CELERYD_OPTS#CELERYD_NODES="worker1
worker2 worker3"# alternatively, you can specify the number of nodes
to start:#CELERYD_NODES=10
# 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
appCELERY_APP="proj"# or fully qualified:#CELERY_APP="proj.tasks:app"
# Where to chdir at start.CELERYD_CHDIR="/opt/Myproject/"
# Extra command-line arguments to the
workerCELERYD_OPTS="--time-limit=300 --concurrency=8"# Configure
node-specific settings by appending node name to
arguments:#CELERYD_OPTS="--time-limit=300 -c 8 -c:worker2 4 -c:worker3
2 -Ofair:worker1"
# Set logging level to DEBUG#CELERYD_LOG_LEVEL="DEBUG"
# %n will be replaced with the first part of the
nodename.CELERYD_LOG_FILE="/var/log/celery/%n%I.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
But nowhere in their documentation is any mention of the fact that
they are using templates or how how make a service a template.
Is there docs on this you can point me to? Or if not just explain it?
On Tue, Dec 5, 2017 at 1:50 PM, Lennart Poettering <lennart at poettering.net>
wrote:
> On Di, 05.12.17 13:33, Doug Snyder (webcoach101 at gmail.com) wrote:
>
> > Getting rid of the template syntax changed the behavior but now it
> appears
> > there's another problem I don't understand.
> > it tries to start the unit and it shows some encouraging signs but fails
> > because a timeout was exceeded.
> > Celery starts and shows healthy output but then sends a SIGCHLD and then
> > dies
>
> Uh, I am not sure what celery is, but if celery is started but exits
> on its own then I am not sure I can help you very much.
>
> > I don't know if you know what celery is but its a task queue so it does
> > create child processes
> > I thought the Type=forking line in the service unit would let systemd
> about
> > that.
> > Or maybe its dying for some other reason?
> > It works fine when run without systemd
>
> Does it detach on its own? i.e. double fork? if yes, then type=forking
> is the right choice, otherwise you need a different Type=.
>
> > I don't think I can send you detailed output until we get this issue
> > resolved with the mailing list and why its not excepting emails with
> debug
> > output.
> > Short emails seem to post. Long ones don't. There's no indication of
> whats
> > going on
>
> There are message size limits on this mailing list. Please condense
> your logs to only include relevant bits hence, or use fpaste.org or
> something like that, and drop the URL.
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20171205/fbebc0d1/attachment.html>
More information about the systemd-devel
mailing list