This project works great on Fedora Workstation. However, it does not on Fedora Silverblue and other rpm-ostree distributions. rpm-ostree manually recreates the /etc/fstab during boot. The udev rules kick off immediately before that finishes so it ends up creating mounts in /media for file systems in the /etc/fstab (boot, root, and home at least). I added a 10 second sleep to the script and then it works as expected.
A short-term hack could be to check for the binary at /usr/bin/rpm-ostree and then add a sleep but that is not ideal. That also slows down mounts after a system is booted where this is no longer an issue. I'll keep exploring better workarounds.
I don't have any of these distros, but could it possibly help to add After=rpm-ostree.service (or whatever the name of this service is) to media-automount@.service?
This project works great on Fedora Workstation. However, it does not on Fedora Silverblue and other rpm-ostree distributions. rpm-ostree manually recreates the
/etc/fstab
during boot. The udev rules kick off immediately before that finishes so it ends up creating mounts in/media
for file systems in the/etc/fstab
(boot, root, and home at least). I added a 10 second sleep to the script and then it works as expected.A short-term hack could be to check for the binary at
/usr/bin/rpm-ostree
and then add a sleep but that is not ideal. That also slows down mounts after a system is booted where this is no longer an issue. I'll keep exploring better workarounds.