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

Lennart Poettering lennart at poettering.net
Wed May 15 10:03:11 UTC 2019


On Mi, 15.05.19 11:57, Ulrich Windl (Ulrich.Windl at rz.uni-regensburg.de) wrote:

> >> could call "systemctl add-wants --transient" to do the job,
> >> but at that point, that's more pedantic than practical. If you write a
> >> generator, your systemd-fu should be high enough to know and
> >> understand systemd's symlink mechanisms...
> >
> > Precisely. if you write your own generator, then you need to know what
> > you do, and need to know how to place your symlinks. You are
> > essentially writing your own unit file installer that way and are
> > expected to create your own symlinks then.
>
> I didn't see it that way: Generated units are just as units installed by some
> package manager, but specific to the local configuration. So why to make
> differences?: A unit is a file that is found by systemd (after the generators
> finished)...

Nope, that's simply not how they are designed. They are a mechanism
how to extend the systemd dependency tree and install additional
nodes in that tree.

If you are looking for a generic converter of foreign stuff into
classic, persistent systemd unit files, then generators is not what
you should be using. Generators are life-cycle bound to systemd
release cycles, and their output ceases to exist on every reload
boundary, and when the system is offline. If we'd allow generated
units to be installed that clear life-cycle would be very much
blurred, as suddenly you'd have configuration that hooks them into the
system that is more persistant than the actual definitions of the
units themselves, and that's just borked...

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.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list