On Di, 05.12.17 14:19, Doug Snyder ([email protected]) wrote: > 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 )
Uh. I figure part of the issue here stems from the fact that "celery" has its own specifier expansion using "%", and that conflicts with systemd's own. i.e. if you us "%I" in a systemd unit file, then systemd will replace it by the instance ID, but this doesn't work if the service is not templated. Now, the celery sysv init scripts on that page also use "%I" which suggests that "%I" is also a construct celery understands on its own. That means that if you have to 'escape' the "%" character properly here, to bypass systemd's expansion so that celery's own expansion can be used. Escaping is done by duplicating the "%". I.e. "%I%n" → "%%I%%n". > Is there docs on this you can point me to? Or if not just explain > it? systemd unit templates are described here: https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Description Look for the paragraph about "Optionally, units may be instantiated from a template file at runtime…" in the "Description" section. That said, I doubt unit templates/instances is what you want here, this is just caused by the confusion that both celery know %I and %n and systemd units do, and hence both want to expand that. Lennart -- Lennart Poettering, Red Hat _______________________________________________ systemd-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/systemd-devel
