Ferk / udev-media-automount

A simple automount mechanism using udev rules
Other
118 stars 57 forks source link

Race condition with rpm-ostree distributions #20

Open LukeShortCloud opened 8 months ago

LukeShortCloud commented 8 months ago

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.

patrislav1 commented 5 months ago

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?