[systemd-devel] Antw: Re: Antw: Re: Re: "bad" status for genersated target; why?

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Thu May 16 06:55:19 UTC 2019


After having read the page again, it's not more clear than before. Even I have some more questions:

Why do generators receive three directory paths: Should the generator decide where at those three paths to add a unit? How should it know? Wouldn't it be easier to provide one path and adjust that as necessary? (My generator just uses the first path)
Also: the only thing that might prevent using a generator for dynamic configuration is that it is called early during boot.

So I could have a generator that just saved the three paths somewhere, and a unit that calls "another generator" that is not detected as a systemd generator using the paths saved before to generate the unit files and do a "systemctl reload-daemon" (watching out for possible indirect recursion). But why the dance?

What makes your generators special? That they have no explicitly settable dependencies, or that they are called with three directory arguments?
And what about the "link stuff": Doesn't reload-daemon create those as needed from the unit files? Why should the generator have to mess with those? It's all not clear from the manual page. The only thing I can imagine is that those "link messing" is needed to provide functionality the systemd actually lacks.


>>> Lennart Poettering 05/15/2019, 12:22 PM >>>
On Mi, 15.05.19 12:08, Ulrich Windl (Ulrich.Windl at rz.uni-regensburg.de) wrote:
> > I mean, if you want to persistently enable a unit that is converted
> > from something else, then please write your own converted, and write
> > something to /etc/systemd/system, there's no need whatsoever to bother
> > systemd itself with that, you shouldn't use generators for that.
> Sorry, I still don't get it: The only(?) difference is the path where they
> (units files) are found, and that the /run directory is volatile. Aren't the
> other differences not just "artificial"?
Please see:
i.e. generators are invoked whenever a reload cycle begins, and output
their units into a specific directories that are flushed our when the
reload cycle ends. i.e. everytime "systemctl daemon-reload" is invoked
the files generated on the current cycles are removed, and the
generators started again to generate a new set of files. Whateever
they generate has very clear, very volatile semantics: issue
"systemctl daemon-reload" and its all gone.
Lennart Poettering, Berlin

More information about the systemd-devel mailing list