[systemd-devel] Dynamic priorities for service loading using systemd ...

Lennart Poettering lennart at poettering.net
Fri Sep 21 08:09:41 PDT 2012


On Fri, 21.09.12 12:37, Hoyer, Marko (ADITG/SW2) (mhoyer at de.adit-jv.com) wrote:

> Hi all,
> 
> hope that is the right forum to raise my question.
> 
> I'm trying to realize a kind of dynamic mandatory / lazy service
> scenario using systemd.
> 
> This means in details that services are either mandatory or
> lazy. Mandatory services are started first, once all man. services
> have been loaded, the lazy ones can be started. It should not occur
> that a lazy service starts before the last mandatory one has been
> started.
> 
> For a static scenario I would define a mandatory target.  For all lazy
> services I would add a Requires and After dependency to this target.
> 
> But in my case, I need a more dynamic scenario. The assignment of
> services to mandatory or lazy is not fixed. It can be changed while
> the system is running or in worst case early during boot up. To my
> understanding I must automatically adapt the .services files of the
> services to realize such a scenario which looks a bit complicated to
> me.

My suggestion would be to use generators for this which dynamically can
extend the systemd dep tree at boot and config reload time:

http://www.freedesktop.org/wiki/Software/systemd/Generators

Whenever your dep changes you just need to invoke Reload() on the
systemd manager on the bus, and systemd will rerun these generators.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list