/run needs handling by OpenRC. We need to mount tmpfs on /run when directory exists. /run is used among others by udev and dracut, but they fall back to /dev/.{udev,initramfs} if /run doesn't exists. Note that /run may be already mounted by dracut. Read more about /run on LWN.net: https://lwn.net/Articles/436012/ It's related to bug #361349. Reproducible: Always
Created attachment 270321 [details, diff] 0001-Mount-tmpfs-on-run-if-directory-exists-and-not-alrea.patch
I looked further at this patch, and I'm concerned about the use of mountpoint. Mountpoint is part of the sysvinit package, so this patch will force a dependency on sysvinit. I would prefer to find another way to do this so we do not require this dependency.
Created attachment 270327 [details, diff] openrc-0.8.2-dont-umount-rundir-on-shutdown.patch openrc also needs this patch or else udev init script fails to stop udev properly on shutdown. For the "mountpoint" command issue I suggest to simply replace the command with "mountinfo" (you can even keep the -q option).
Created attachment 270341 [details, diff] 0001-Mount-tmpfs-on-run-if-directory-exists-and-not-alrea.patch Polynomial-C, thanks! This one uses mountinfo instead of mountpoint. I have tested all three cases: - /run doesn't exist; - /run exists but is not a mount point; - /run exists and is a mount point (/run mounted by dracut in initramfs-time); and it's OK.
Created attachment 270397 [details, diff] Mount-tmpfs-on-run-and-create-run-lock.patch Added creation of /run/lock with privileges compliant with /var/run.
Commits ede4d1c and 64ef51a apply the patches from this bug with a slight modification. I added a chmod command to change the mode for /run/lock to match /var/lock; e.g. 775. This will be part of openrc-0.8.3.
Why does this bug block the stablereq tracker? As /run is a relatively new concept, are udev/dracut versions even marked stable yet that would use it?
You are right, it doesn't need to block the tracker. I tested the code myself before I put it into git, and it is fully backward compatible (if /run doesn't exist, nothing is done), so that is why I went ahead and committed it.
(In reply to comment #6) > Commits ede4d1c and 64ef51a apply the patches from this bug with a > slight modification. > > I added a chmod command to change the mode for /run/lock to match > /var/lock; e.g. 775. > > This will be part of openrc-0.8.3. I did chown and chmod independently of creation of /run/lock intentionally. Please consider the case when /run/lock is created in initramfs-time with different owner/privileges. Shouldn't happen, but my approach assures that it will be OK.