[systemd-devel] Managing autogenerated services

Lennart Poettering lennart at poettering.net
Wed Jun 15 12:05:06 PDT 2011


On Wed, 01.06.11 15:36, yoshi watanabe (yoshi314 at gmail.com) wrote:

> Hi all
> 
> I'd like to know how can one manage services that are being auto
> generated (e.g. mount points or cryptsetup).
> 
> In case of mount points, i would like to have all mount services
> depend on arbitrary service of my choice. How do i do that?

This is currently not really possible. 

However, there has been an item on the TODO list, which when implemented
would allow this: an option to import default settings for all units
from generic per-type config files. i.e. the idea would be to implicitly
read all service files as if they had a ".include
/lib/systemd/system/defaults/service" or so at the top. That way you
could just place your deps in that and you should have what you are
asking for.

While this is easy to implement, this is difficult to implement in a way
that is pretty and does not require us to reparse the included config
file over and over again.

> in case of cryptsetup - since my initrd (dracut) already opens the
> encrypted storage the autogenerated systemd cryptsetup service keeps
> timing out. How do i disable a service that's automatically generated
> by one of systemd helpers?

Well, you can always mask tem, by symlinking them to /dev/null in
/etc/systemd/system. systemd will recognize that and consider them
masked and never activate them.

But dracut and systemd should actually cooperate just fine for encrypted
disks.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list