I have a systemd service mounting a partition of a UFS LU to /mnt
## bt_mount.service ##
[Unit]
Description=Mount bt_firmware_a/b to /mnt
[Service]
Type=oneshot
PassEnvironment="SLOT" ## "_a" or "_b", depends on the boot slot
ExecStart=/bin/mount -o noexec,nodev,ro /dev/disk/by-partlabel/bt_firmware${SLOT} /mnt
[Install]
WantedBy=local-fs.target
BUT
It fails sometimes saying that "special device /dev/disk/by-partlabel/bt_firmware_a does not exist"
systemd-analyze shows that bt_mount.service gets to run before the symbol-link is created, that is the cause.
I search on google and get to know that systemd-udevd.service plays an important role to create thoes symlink, and it will creates them when udevadm --trigger.
systemd-udevd.service
systemd-udevd-trigger.service
I had tried to add dependency for the service using statement below, but still the same.
After=systemd-udevd-trigger.service systemd-udevd.service
So, it there any way to let some service launch after the specific symlink is created?