Separate /run and /var/run
I vaguely remember when /run was first instituted. I seem to remember that there were various breakages due to the changes at the time. I was running Debian at that time and haven't turned up any old discussions about it for Slackware for that time period (spring/summer 2011). It came to my attention recently that /var/run and /run on Slackware64-14.1 system are separate directories. I have been researching this via web search, the FHS 2.3 and 3.0, as well as comparing how other distros handle /run and /var/run.
This is the Debian policy: https: //www.debian.org/doc/debian-policy/ch-opersys.html#s9.1 This is Arch's current PKGBUILD for base filesystem: https://projects.archlinux.org/svnto...ges/filesystem Gentoo has this bug report: https://bugs.gentoo.org/show_bug.cgi?id=361349 Crux uses separate directories: http://crux.nu/gitweb/?p=ports/core....d28b66;hb=HEAD I'm still in the process of looking at Suse, Fedora, and Ubuntu and perhaps others. I've searched the Slackware forum for this and so far haven't turned up anything. I've read the relevant part of the newer FHS (3.0); it describes /var/run as a link to /run. One issue I can forsee with /var/run being a link to /run is that there may be (probably are) necessary subdirectories that need to exist in the runstate hierarchy. One thing I'm not trying to do is make a judgement call here on what is correct handling of /run and /var/run. I merely would like some discussion about the topic and try to understand possible impact and ramifications if /var/run were a symlink to /run. |
Well, so that all readers know what this is about, here is a quote from the FHS 3.0 Draft 1
Code:
3.15. /run : Run-time variable data Now here is my input in the discussion.
PS You wrote: Quote:
Quote:
Oh and even if most other distributions make that symlink that doesn't imply that Slackware neither should nor will do the same. That is true also for the whole /run thing. |
Thank you, Didier. I appreciate and respect your input. Thank you for clarifying/reiterating the point about the validity of /var/run as a symlink /run, but not requiring it; sometimes my thinking needs a bit of the hammer before things sink in. I will consider your suggestion about using the fhs-discuss mailing list. An important point to me, though, is that I am more curious about the view of this from a Slackware perspective. I am not saying that the current handling of /run and /var/run in Slackware is wrong, only that I would like more insight. Also, I would venture to guess that the BDFL is much more knowledgeable than I am for what works best for Slackware in this and most cases.
One last thing. I don't think there necessarily needs to be any action on this at all. You bring in a very valid point... "if it ain't broke, don't fix it." Perhaps it is only my understanding is all that needs a little tweaking. You have helped some with that. Cheers, John |
Quote:
For example, I might have a service that copies a database to /var/run/ (this permits me to make changes to the off-line db without changing the publc website). I would not want to have that database stored on my root partition because 1) it might potentially be a very large file/directory and 2) my root partition potentially might have rather slow write access (but good read access). Granted my approach is rather non-standard, and its mainly beneficial for developing my service. Nonetheless, it works for me and I should not like for my use case to be dismissed without good reason, and I do not see any advantage to using a symlink over just having the two directories. |
Quote:
|
Quote:
The nice feature that /var/run offers compared to /var/tmp is that it gets wiped during reboot. To be clear, I think /run is a good idea (and Slackware puts it to good use), but symlinking /var/run places unnecessary restrictions upon certain uses. |
Thanks, saulgoode. I'm glad to hear your points. I think that your use case is a strong point against the symlinking /var/run to /run. I can see another one, especially given your senario: /run is mounted with a tmpfs, so storing large databases there could be problematic for memory usage as well (ah, I see T3slider beat me to that point).
Ok, got me reading the fhs section on /run once again and I can't believe that this part didn't sink in well enough: Quote:
My two cents is that /var/run and /run being separate is a good setup, specifically to maintain backwards compatibility. Thanks to Didier, saulgoode and T3slider for having a look at my query and the patience to give it some consideration and reply. Cheers, John PS, saulgoode, just to clarify, /run is mounted in /etc/rc.d/rc.S on line 26... |
Quote:
Quote:
Code:
cat /proc/mounts Code:
mount [/off-topic] |
Quote:
On the subject of symlinking mtab -> /proc/mounts, I really don't like that idea. I've noticed a behavioural difference between /proc/mounts and /etc/mtab: specifically, /proc/mounts appears to get updated on an unmount long before /etc/mtab is. My assumption is that /proc/mounts is updated at the start of the unmount operation when the filesystem is detached from the hierarchy -- presumably to prevent anything new from accessing it -- where as /etc/mtab is updated when everything is flushed and the unmount completes. It's particularly noticeable with slow media such as a flash drive. As I use autofs for the mounting/unmount of flash media, I rely on /etc/mtab to know whether I can safely unplug my device; unlike running a unmount command directly, I don't get confirmation the unmount has completed doing it the way I do ('pkill -USR1 automountd' bound to a hot-key). |
Thank you all for setting me straight on the /run tmpfs situation. As I am currently running my server on an old Pentium with only 384MB of memory (with thoughts of eventually switching to a BeagleBone or somesuch), this makes avoiding large files in /run even more important (though my server is still on Slackware 14.0, so /run isn't yet an option).
I am enlightened. :) |
All times are GMT -5. The time now is 10:35 PM. |