[systemd-devel] crypttab automount

Ralf Jung post at ralfj.de
Tue Jul 22 10:37:02 PDT 2014


Hi,

> When "foo at bar.service" is accessed, systemd first searches for the
> exact name "foo at bar.service", and only then for "foo at .service", to
> allow certain instances to be customized.
> 
> Since systemd-cryptsetup at .service is only used through the cryptsetup
> generator, and since there are quite a few parameters (all of which
> really couldn't fit within a single "instance" value), the generator
> uses this feature and creates a separate unit with the right
> parameters for each instance, so systemd never needs to fall back to
> looking for the template unit.

I see, so the template syntax is only used here to scope things together
- there's not actually a template involved here.

> Look in /run/systemd/generator for the output of all generators. Use
> the generated systemd-cryptsetup@*.service units as base for your
> custom ones. (The administrator overrides in /etc always take priority
> over generated and package-distributed units in /run and /lib.)

Thanks a lot! I copied the service file to /etc/systemd/system and
removed the "Before" line, and now indeed starting the rest of the
system is not blocked by opening the cryptodisk anymore. Amazing!

Now I wonder, is there any way I can do this that does not involve
duplicating this service file? I am worried about future versions of
systemd changing how to interact with "/lib/systemd/systemd-cryptsetup",
in which case my file would obviously not getting updated.

I tried creating a folder "systemd-cryptsetup at store.service.d" in
/etc/systemd/system in which I put a file no-before.conf with content

  [Unit]
  Before=

But that doesn't seem to work, the "systemctl show" still shows
"Before=cryptsetup.target. Is it somehow possible to remove/override an
option using these drop-in files?

Kind regards
Ralf


More information about the systemd-devel mailing list