<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 19, 2021, 09:50 Ulrich Windl <<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-regensburg.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">>>> Andrei Borzenkov <<a href="mailto:arvidjaar@gmail.com" target="_blank" rel="noreferrer">arvidjaar@gmail.com</a>> schrieb am 19.01.2021 um 06:30 in<br>
Nachricht <<a href="mailto:3a365c71-004e-031e-4153-80c376d80838@gmail.com" target="_blank" rel="noreferrer">3a365c71-004e-031e-4153-80c376d80838@gmail.com</a>>:<br>
> 19.01.2021 04:00, lejeczek пишет:<br>
>> hi guys.<br>
>> <br>
>> I'm fiddling with it but have run out of options/ideas.<br>
>> What I would like to have is systemd starts a service when a device, in<br>
>> my case a crypt-luks device, gets mounted which mount would happen by<br>
>> manual 'cryptsetup open'<br>
> <br>
> I am not aware that "cryptsetup open" mounts anything. I do not even see<br>
> any option to specify mount point in its invocation. Please show exact<br>
> command you are using that "mounts" encrypted container.<br>
<br>
But it will make some device (/dev/mapper) to appear.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yes, and that can be used to trigger a mount unit.</div><div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><br></div><div dir="auto">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:</div><div dir="auto"><br></div><div dir="auto">systemctl add-wants 'dev-mapper-luks\x2bfoo.device' foo.mount</div><div dir="auto"><br></div><div dir="auto"><br></div></div>