I'm still struggling to understand boot sequence dependency configuration in systemd unit files. I've read the manual (systemd.unit
).
I tried to add dependencies using the After=
and Requires=
lines to my unit configuration file. However it still regulary fails during system startup because systemd starts it too early before a needed resource (in my case a LUKS encrypted volume) has become available. In my tests it looked like systemd is ignoring these configuration lines. The content of these lines is also not listed when using the command:
systemctl list-dependencies
to check for configured dependencies.
Example: My device volume is /dev/dm-6
. How can I specify that systemd should wait with starting my unit until this device has finally appeared?
If I start my unit manually in a terminal window after boot using this command:
systemctl start
name_of_my_unit
it works fine.
systemd.device
might be what you wantLinks
RequiresMountsFor=/mnt/volume
Where the path is in the required mount point.
May be you should check
ExecStartPre=
andExecCondition=
. Looks like they able to solve your issue.