[systemd-devel] Antw: [EXT] Re: successful mount starts a service - how?

Mantas Mikulėnas grawity at gmail.com
Tue Jan 19 08:13:03 UTC 2021


On Tue, Jan 19, 2021, 09:50 Ulrich Windl <Ulrich.Windl at rz.uni-regensburg.de>
wrote:

> >>> Andrei Borzenkov <arvidjaar at gmail.com> schrieb am 19.01.2021 um 06:30
> in
> Nachricht <3a365c71-004e-031e-4153-80c376d80838 at gmail.com>:
> > 19.01.2021 04:00, lejeczek пишет:
> >> hi guys.
> >>
> >> I'm fiddling with it but have run out of options/ideas.
> >> What I would like to have is systemd starts a service when a device, in
> >> my case a crypt-luks device, gets mounted which mount would happen by
> >> manual 'cryptsetup open'
> >
> > I am not aware that "cryptsetup open" mounts anything. I do not even see
> > any option to specify mount point in its invocation. Please show exact
> > command you are using that "mounts" encrypted container.
>
> But it will make some device (/dev/mapper) to appear.
>

Yes, and that can be used to trigger a mount unit.

With earlier systemd versions it was actually enough to have a fstab entry
with "auto,nofail" and systemd would immediately activate such mounts as
soon as the source device appeared.

In systemd v242 this behavior was removed (and unfortunately, there is no
convenient fstab option to re-enable it), but the same type of dependency
can still be manually added using:

systemctl add-wants 'dev-mapper-luks\x2bfoo.device' foo.mount
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20210119/61875a46/attachment.htm>


More information about the systemd-devel mailing list