Re: [systemd-devel] How to automatically decrypt a disk on connection

2024-03-28 Thread Orion Poplawski
On 3/28/24 01:30, Andrei Borzenkov wrote: On Wed, Mar 27, 2024 at 9:49 PM Orion Poplawski wrote: Use $kernel in rule and /dev/%I in service. Thank you, that works. udev monitor -p doesn't show the value of KERNEL so I didn't see that as an option. udev documentation lists $kernel when de

Re: [systemd-devel] How to automatically decrypt a disk on connection

2024-03-28 Thread Andrei Borzenkov
On Wed, Mar 27, 2024 at 9:49 PM Orion Poplawski wrote: > > > > Use $kernel in rule and /dev/%I in service. > > Thank you, that works. udev monitor -p doesn't show the value of KERNEL so I > didn't see that as an option. > udev documentation lists $kernel when describing substitutions. But yes,

Re: [systemd-devel] How to automatically decrypt a disk on connection

2024-03-27 Thread Orion Poplawski
On 3/27/24 12:22, Andrei Borzenkov wrote: > On 27.03.2024 20:56, Orion Poplawski wrote: >> The only thing that's a bit funky with it is that it generates: >> >> Invalid unit name "clevis-luks-unlock@/dev/sda1.service" escaped as >> "clevis-luks-unlock@-dev-sda1.service" (maybe you should use >> sy

Re: [systemd-devel] How to automatically decrypt a disk on connection

2024-03-27 Thread Andrei Borzenkov
On 27.03.2024 20:56, Orion Poplawski wrote: On 3/27/24 10:22, Mantas Mikulėnas wrote: On Wed, Mar 27, 2024, 16:36 Orion Poplawski mailto:or...@nwra.com>> wrote: Can I setup a unit that gets started automatically when a particular dev-disk-by-uuid device becomes present? Just lin

Re: [systemd-devel] How to automatically decrypt a disk on connection

2024-03-27 Thread Orion Poplawski
On 3/27/24 11:56, Orion Poplawski wrote: > On 3/27/24 10:22, Mantas Mikulėnas wrote: >> >> >> On Wed, Mar 27, 2024, 16:36 Orion Poplawski > > wrote: >> >> >> >> Can I setup a unit that gets started automatically when a particular >> dev-disk-by-uuid device becomes pre

Re: [systemd-devel] How to automatically decrypt a disk on connection

2024-03-27 Thread Orion Poplawski
On 3/27/24 10:22, Mantas Mikulėnas wrote: > > > On Wed, Mar 27, 2024, 16:36 Orion Poplawski > wrote: > > > > Can I setup a unit that gets started automatically when a particular > dev-disk-by-uuid device becomes present? > > > Just link it under dev-disk-foo.d

Re: [systemd-devel] How to automatically decrypt a disk on connection

2024-03-27 Thread Mantas Mikulėnas
On Wed, Mar 27, 2024, 16:36 Orion Poplawski wrote: > > > Can I setup a unit that gets started automatically when a particular > dev-disk-by-uuid device becomes present? > Just link it under dev-disk-foo.device.wants/ (systemctl enable, or systemctl add-wants). Alternatively, ENV{SYSTEMD_WANTS}=

Re: [systemd-devel] How to automatically decrypt a disk on connection

2024-03-27 Thread Orion Poplawski
On 3/27/24 07:29, Andrei Borzenkov wrote: On Wed, Mar 27, 2024 at 12:35 AM Orion Poplawski wrote: Sorry this isn't strictly devel - but it is a bit non-standard. I need to automatically unlock an encrypted disk on connection to a machine, with the caveat that I'm not mounting it - instead I w

Re: [systemd-devel] How to automatically decrypt a disk on connection

2024-03-27 Thread Andrei Borzenkov
On Wed, Mar 27, 2024 at 12:35 AM Orion Poplawski wrote: > > Sorry this isn't strictly devel - but it is a bit non-standard. > > I need to automatically unlock an encrypted disk on connection to a machine, > with the caveat that I'm not mounting it - instead I want to connect it to a > VM. > > On

[systemd-devel] How to automatically decrypt a disk on connection

2024-03-26 Thread Orion Poplawski
Sorry this isn't strictly devel - but it is a bit non-standard. I need to automatically unlock an encrypted disk on connection to a machine, with the caveat that I'm not mounting it - instead I want to connect it to a VM. On machines that we do mount the filesystem, having an fstab entry seems to