[systemd-devel] crypttab automount

Mantas Mikulėnas grawity at gmail.com
Mon Jul 21 06:11:37 PDT 2014


On Mon, Jul 21, 2014 at 3:18 PM, Ralf Jung <post at ralfj.de> wrote:
> I also tried to figure out how to manually create an appropriate
> "systemd-cryptsetup@" instance so that I wasn't restricted by the
> crypttab generator (and could control the dependencies myself), but I
> couldn't figure out how to tell such an instance the necessary
> parameters (like the keyfile). I couldn't even find the
> "systemd-cryptsetup at .service" template file. It seems to me that I
> either misunderstood that template stuff, or there's special magic going
> on for this template.

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.

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.)

-- 
Mantas Mikulėnas <grawity at gmail.com>


More information about the systemd-devel mailing list