I have an encrypted partition that I configured with crypttab like
/etc/crypttab:
name UUID=<THE_UUID> none luks,noauto
and /etc/fstab
UUID=<THE_UUID> /mnt/mountpoint ext4 defaults,noauto 0,0
Now, I want the unit nfs-server.service
to start up automatically once I manually decrypted the partition using systemctl start [email protected]
. With some advice on the #debian-Matrix-Channel I finally got
# systemctl edit nfs-server.service
[Unit]
[email protected]
After=mnt-mountpoint.mount
Requires=mnt-mountpoint.mount
With this setup I can start the nfs-server after decrypting manually. Still, I'd prefer systemd to automatically start nfs-server (which in turn should already auto-mount the then decrypted partition).
How do I need to edit the nfs-server.service
(or maybe even another unit?) in order for systemd to start it automatically once I decrypted the partition? I guess I could similarly use the logic for other units to start automatically after the nfs-server.service
?