|
|
Subscribe / Log in / New account

Introducing /run

From:  Lennart Poettering <mzerqung-AT-0pointer.de>
To:  Fedora Development ML <devel-AT-lists.fedoraproject.org>
Subject:  What's this /run directory doing on my system and where does it come from?
Date:  Wed, 30 Mar 2011 13:54:30 +0200
Message-ID:  <20110330115430.GA3115@tango.0pointer.de>
Archive‑link:  Article

Heya,

I just uploaded a new version of systemd into F15, which establishes a
directory /run in the root directory. Most likely you'll sooner or later
stumble over it, so here's an explanation what this is and why this is.

It's a fairly minor technical change, though presumably people consider
this a bigger political change, so I guess this deserves an
explanation:

For quite a while programs involved with early boot used to place
runtime data in /dev under numerous hidden dot directories. /dev/.udev
was the first one, but over time this grew to at least /dev/.mdadm,
/dev/.systemd, /dev/.mount, dracut, initscripts and more tools. (Other
distros have even more) The reason they used directories there is that
/dev was known to be a tmpfs and available from the first instant the
machine was booted. /var/run otoh is only available very late at
boot, since /var might reside on a separate file system.

However, /dev always has been an inappropriate and ugly place for
runtime data: runtime data is not a device node, and thus simply does
not belong there. Also, hiding the existance of directories from the
administator is a bad idea. Then, the fact that some runtime data was
placed in /var/run/xxx, and other in /dev/.yyy is often not
understandable to ther user, and especially when tools originally
intended to be used only after boot are needed during early boot a
complicated move between these directories needed to take place.

Over time different distributions experimented with different broken
solutions for the early-runtime-dir problem: on Debian /lib/init/rw was
introduced, a tmpfs fs mounted during early boot. On Ubuntu /var/run was
mounted as tmpfs even before /var itself was mounted, with some really
ugly bind mount magic. Most software however just sidestepped the issue
and used /dev/.xxx. 

In the past weeks key people from the Debian, Suse, Ubuntu and Fedora
camps (and others, too) discussed the whole issue forth and back, to
find a solution to stop the misuse of /dev before it becomes even more
widespread. Various solutions have been suggested, but in the end it all
boiled down to the fact that /var/run does not belong beneath /var and
what we really want is a top-level directory /run, and that that is the
only really clean solution. The only reason why nobody dared to actually
implement such a directory was unwillingness to deal with the political
backlash, especially messy discussions on mailing lists like this one.

Understanding this, we came to the conclusion that we should rather
implement what everybody thinks is the right technical solution, instead
of evading the political backlash for it. And so we implemented this.

With this upload Fedora and Suse have already adopted /run now. Debian
folks will suggest this for their coming release. Ubuntu has agreed with
introducing /run as well.

Dracut, udev and systemd have already been updated upstream to make use
of /run. We expect mdadm and mount to follow suit quickly.

A few years back Debian folks already suggested introduction of /run,
and even pinged LSB folks about this, and back then there even was a vaguely
positive response from them.

So, what is implemented in F15 precisely?

/run is now a tmpfs, and /var/run is bind mounted to it. /var/lock is
bind mounted to /run/lock. Applications can use /run the same way as
/var/run. Since the latter is FHS/LSB most apps should just use the
latter, only early boot stuff should use /run, for now. The folks who
have packages where this applies already have been informed. If you
haven't heard from any of us, then this doesn't apply to you.

So, what's the benefit of this again?

- There's only one tmpfs used, backing /run, /var/lock and /var/run,
  reducing a bit the ever increasing amount of tmpfs' used on a default
  system.

- All runtime data at the same place. systemd's, udev's, dracut's data
  are all beneath /run and /var/run now. Easily discoverable to the
  admin. For the first time you can see the data all these important
  tools used on your system store just like any other by doing "ls
  /var/run".

- Nothing is hidden anymore. The admin can see everything beneath
  /var/run and /run, no hidden dot-files anymore.

- We have standardized the early-runtime-dir solution across all major
  distributions

- The people involved feel much better since they don't have to misuse
  /dev anymore

- The lifecycle properties of directories are clear from the top-level
  directory name. Lifecycle properties do no longer change the further
  you go down your tree. i.e. /var is "persistant runtime data" and /run
  is "volatile runtime data", and /etc is "persistant system config
  data", and so on. The ugliness that /var/run abd /var/lock had
  completely different liftime guarantees than /var where they both
  reside in is gone.

So, this is what is implemented for F15 now. For F16 we will make a
minor change on top of this: /var/run and /var/lock will become symlinks
to /run (resp /run/lock), so that we don't have to use bind mounts
anymore which are not the most beautiful thing to use by default, and
confusing to the admin. Due to the implications of symlinks and RPM we
didn't want to make that change in F15.

The actual code changes we needed to implement this scheme were trivial
(basically, just bind mount /var/run and /var/lock instead of mounting two
new tmpfs' to them.), which is why we opted to do this so late in the F15
cycle. However, the political implications are much bigger I guess, so
let's see what a fantastic flamewar we can start with this on
fedora-devel now. Flame away!

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel




(Log in to post comments)

Introducing /run

Posted Mar 30, 2011 14:23 UTC (Wed) by rriggs (guest, #11598) [Link]

Sounds like both FHS & LSB need to be updated. Any idea when this would happen?

Introducing /run

Posted Mar 30, 2011 14:39 UTC (Wed) by rahulsundaram (subscriber, #21946) [Link]

FHS hasn't been updated in a long time. However a request has been opened at

http://bugs.freestandards.org/show_bug.cgi?id=718

I completely expect nothing to be done about it.

Fixed link

Posted Oct 19, 2014 1:22 UTC (Sun) by JesseW (subscriber, #41816) [Link]

The LF moved this, and broke the links -- it's now at: https://bugs.linuxfoundation.org/show_bug.cgi?id=718 . The bug is still in ASSIGNED state, with 19 comments, the most recent of which was on 2011-08-23.

Fixed link

Posted Oct 19, 2014 2:01 UTC (Sun) by rahulsundaram (subscriber, #21946) [Link]

I am disappointed but completely unsurprised to hear my prediction come true.

Introducing /run

Posted Mar 30, 2011 15:05 UTC (Wed) by rleigh (guest, #14622) [Link]

Sounds like a good plan. I don't see why there should be any fear of controversy here--it's a standard replacement for the various ad hoc methods that were already in place. I was an early proponent and adopter of /lib/init/rw (replacing buggy use of /dev/shm as the tmpfs of choice for resolvconf), and /run will be a good replacement, which also cleans up the use of transient files stored under /var.

Reading the thread, there seemed to be good consensus on the need for /run, with one vocal individual disagreeing; however, the disagreement did not appear to address the fact that the existing FHS does not address the need for /run, and that standards are built on consensus, not set in stone. I'm sure that /run could be added to the FHS following its introduction. The FHS has not always established existing practice though--I'm still waiting for /libexec which both the BSDs and GNU coding standards have long supported, and it's a rather glaring incompatibility.

One thing I was going to mention was that LVM will no longer need to keep its cache files under /etc, which was a long-standing flaw in it, making a read-only rootfs easier to achieve. I subsequently found Alasdair Kergon's comments in the thread, which were nice to see. We could also get rid of /etc/mtab as well, without the need for a symlink to /proc/mounts before mount(8) is fully capable of operating without a writable mtab.

Is anyone working on supporting /run in Debian, and replacing /lib/init/rw?

Regards,
Roger

Introducing /run

Posted Mar 30, 2011 15:25 UTC (Wed) by mezcalero (subscriber, #45103) [Link]

/etc/mtab is a symlink to /proc/self/mounts on F15. That problem is solved.

Lennart

Introducing /run

Posted Mar 30, 2011 15:37 UTC (Wed) by rvfh (guest, #31018) [Link]

You mean my dream of a read-only / including /etc could soon become reality?
I believe it's one of your goals too, isn't it?

Good job.

Introducing /run

Posted Mar 30, 2011 16:17 UTC (Wed) by mezcalero (subscriber, #45103) [Link]

Yes, and we are almost there.

Lennart

Introducing /run

Posted Mar 30, 2011 16:26 UTC (Wed) by rleigh (guest, #14622) [Link]

From my discussions with the mount maintainer, this is only completely solved if you're using systemd. For others, it's still broken in some cases, such as read-only bind mounts and NFS mounts:

http://article.gmane.org/gmane.linux.utilities.util-linux...
http://thread.gmane.org/gmane.linux.utilities.util-linux-...

Until Debian adopts systemd exclusively, we are still going to need the above issues fixing before making mtab a symlink. While I would like to see systemd adopted in Debian, I think support for non-Linux kernels is a potential blocker here, mainly for kfreebsd, and Hurd to a lesser extent, if we are to have a unified init across all supported kernels. Not that any of that is my call, just a consideration to bear in mind. It is also likely that Debian will allow other inits such as upstart, which will also require util-linux-ng and related tools to support the above as well.

Regards,
Roger

Introducing /run

Posted Mar 30, 2011 18:49 UTC (Wed) by cmorgan (guest, #71980) [Link]

Support for other non-linux platforms is nice but many of these other non-linux platforms aren't the fastest moving or end up rejecting things done in linux because they aren't done The Right Way(tm).

Introducing /run

Posted Mar 31, 2011 14:21 UTC (Thu) by nye (guest, #51576) [Link]

>Support for other non-linux platforms is nice but many of these other non-linux platforms aren't the fastest moving or end up rejecting things done in linux because they aren't done The Right Way(tm).

Note that the GP did not say 'platforms', but 'kernels', which is an important distinction in this context.

Introducing /run

Posted Mar 31, 2011 4:49 UTC (Thu) by ebiederm (subscriber, #35028) [Link]

On f14 /etc/mtab does not handle bind mounts properly when it is a symlink to /proc/mounts. Has that been fixed?

Introducing /run

Posted Mar 31, 2011 9:38 UTC (Thu) by rahulsundaram (subscriber, #21946) [Link]

Yes, a new version of util-linux fixes that and the change is upstream.

Introducing /run

Posted Mar 30, 2011 14:36 UTC (Wed) by nhippi (guest, #34640) [Link]

That's one welcome move! I for one welcome our new /run introducing overlords!

Introducing /run

Posted Mar 30, 2011 17:18 UTC (Wed) by nix (subscriber, #2304) [Link]

Quite. It's so obviously the right idea in hindsight: why did nobody do it ten years ago rather than endlessly thrashing about jamming it under various other top-level directories?

(new directories in / do not bite, as long as they don't propagate too much. But /run is plainly good.)

Introducing /run

Posted Mar 30, 2011 23:24 UTC (Wed) by roblucid (guest, #48964) [Link]

Yep, as a grizzled besandled trad sysadmin dude I can't see a real problem with a /run, though if there's a proliferation of "housekeeping" then I would like it all to get mounted under one place. Let's hope, any other similar usages fit under /run rather than their own TLD.

I say this, and I HATED the dictat that / & /usr ought not be in seperate FS's no more, where I was in the old-fart reactionary camp, believing in the right to segregate different kinds of data, to ease the admin of systems.

Fact was, I would create my own TLD's for each significant group of users, and not rely on /usr or /home, for a local machine centric view of the world.

Introducing /run

Posted Mar 31, 2011 8:19 UTC (Thu) by rleigh (guest, #14622) [Link]

At least for the case of / and /usr, they really aren't different kinds of data, at least on a modern distribution with a package manager. On such a modern system, there are essentially two major types of file: those under the control of a package manager, and those which are not (system and user data). The / and /usr split really doesn't make a lot of sense when you get down to the details:

http://lists.debian.org/debian-devel/2011/01/msg00152.html

Introducing /run

Posted Mar 31, 2011 16:46 UTC (Thu) by vonbrand (guest, #4458) [Link]

Great! Every file handled by the package manager goes under /pkg, everything else under /nopkg. Nice, orderly system with /pgg/emacs, /pkg/gcc, ... ;-)

Introducing /run

Posted May 4, 2011 21:29 UTC (Wed) by nix (subscriber, #2304) [Link]

You think you're joking:

nix@mutilate 125 /home/nix% ls -l /pkg/emacs/
total 12
drwxr-xr-x 6 root root 4096 Apr 6 16:49 23.3-5568-1
drwxr-xr-x 6 root root 4096 May 2 22:55 24.1-104079
drwxr-xr-x 6 root root 4096 May 4 14:46 24.1-104105

nix@mutilate 126 /home/nix% ls -l /pkg/ncurses/
total 20
drwxr-xr-x 5 root root 4096 Sep 11 2009 5.7-20090815-old
drwxr-xr-x 6 root root 4096 Jan 16 14:30 5.7-20110108
drwxr-xr-x 6 root root 4096 Jan 16 14:35 5.7-20110108-32
drwxr-xr-x 6 root root 4096 Jan 16 14:31 5.7-20110108-wide
drwxr-xr-x 6 root root 4096 Jan 16 14:39 5.7-20110108-wide-32

All installed via DESTDIR and symlinked into place by graft.

Introducing /run

Posted Mar 30, 2011 14:46 UTC (Wed) by nvloff (guest, #73737) [Link]

An interesting turn in the discussion at the fedora-devel list suggests that the people responsible for the change( or maybe just Lennart as the messenger, because it's cool to flame him) are a bunch of crack addicted rapists.

On a more serious note: it seems like this whole standards thing seems dead ( FHS, freestandards.org, etc). And like Python is defined by it's implementation, the current state of the Debian/Ubuntu/Fedora distributions should be considered the standard instead of some document that was last updated 6 years ago.

Introducing /run

Posted Mar 30, 2011 19:26 UTC (Wed) by mmcgrath (guest, #44906) [Link]

> instead of some document that was last updated 6 years ago.

It's a fallacy to think that just because something is old that it is invalid or somehow faulty.

Introducing /run

Posted Mar 30, 2011 19:40 UTC (Wed) by rahulsundaram (subscriber, #21946) [Link]

No, it doesn't automatically mean that. However in this case, it is unmaintained and requests to enhance or clarify the document has not been answered. So it is indeed faulty and doesn't represent the current reality for a number of years.

Introducing /run

Posted Mar 31, 2011 13:55 UTC (Thu) by jcm (subscriber, #18262) [Link]

So then that needs fixing. Bring it up at LFCS next week or something. I'm with Mike on this one - just because it's old and hasn't been re-invented this week to be all Web 2.0 doesn't mean it's invalid. If LFS needs a new home or whatever, that's a totally separate issue.

Introducing /run

Posted Mar 31, 2011 20:26 UTC (Thu) by rahulsundaram (subscriber, #21946) [Link]

Don't engage in handwaving. People have been trying since 2005 to get it updated. If you want to lead an effort to update it, go ahead and do it. Noone else is apparently interested in that. Otherwise what is in the latest major distributions is the living standard.

Introducing /run

Posted Mar 30, 2011 14:59 UTC (Wed) by sahko (guest, #54088) [Link]

Unlike /selinux which is an application specific directory and a direct violation of FHS, however deprecated it might be, the application independent /run actually makes some sense.

Introducing /run

Posted Mar 31, 2011 19:39 UTC (Thu) by vonbrand (guest, #4458) [Link]

SELinux is certainly not an "application"...

Introducing /run

Posted Mar 30, 2011 15:01 UTC (Wed) by handock (guest, #73633) [Link]

It makes me sad that this troll is taken serious.

He just transformed easy hackable start-up shell scripts
into buggy and unmaintainable C code. (systemd)

But that was only his first step. He's now obviously aiming
to infect the remaining sane rests of the Linux-world with his
idiotic ideas and world-view.

And the developers applaud and follow him like mindless sheep.

Introducing /run

Posted Mar 30, 2011 15:04 UTC (Wed) by mezcalero (subscriber, #45103) [Link]

Endlich sagt's mal einer!

Introducing /run

Posted Mar 30, 2011 15:07 UTC (Wed) by handock (guest, #73633) [Link]

Jau, musste mal sein.

Introducing /run

Posted Mar 30, 2011 15:11 UTC (Wed) by Trelane (subscriber, #56877) [Link]

;) Tolles trollen, net?

Introducing /run

Posted Mar 30, 2011 16:43 UTC (Wed) by petegn (guest, #847) [Link]

English please

Introducing /run

Posted Mar 30, 2011 17:12 UTC (Wed) by Trelane (subscriber, #56877) [Link]

mezcalero:
> Finally, someone says it!

handock:
> Yes, it had to be.

Trelane:
> ;) Great trolling, no?

petegn:
> Deutsch, bitte

[toggle and recurse]

Introducing /run

Posted Mar 30, 2011 17:16 UTC (Wed) by Trelane (subscriber, #56877) [Link]

I've reconsidered. I would have to say that as a Lennart Pöttering-related trolls go, it loses substantial points for not referencing The Audio Project. ;)

Introducing /run

Posted Mar 30, 2011 17:19 UTC (Wed) by mezcalero (subscriber, #45103) [Link]

My name is "Poettering", with "oe", as in "Goethe". Not "Pöttering".

Introducing /run

Posted Mar 30, 2011 17:20 UTC (Wed) by Trelane (subscriber, #56877) [Link]

Poettering, tut mir Leid.

Introducing /run

Posted Mar 30, 2011 17:30 UTC (Wed) by jengelh (subscriber, #33263) [Link]

Well at least they did not try to use œ or ø in there.

Introducing /run

Posted Mar 30, 2011 17:53 UTC (Wed) by Trelane (subscriber, #56877) [Link]

How about ó or ò or õ or ô or &#7887; or &#333;?

Introducing /run

Posted Mar 30, 2011 18:13 UTC (Wed) by jengelh (subscriber, #33263) [Link]

>How about ó or ò or õ or ô or &#7887; or &#333;?

Not a front-rounded vowel AFAICT.

Introducing /run

Posted Mar 30, 2011 18:42 UTC (Wed) by mpr22 (subscriber, #60784) [Link]

o-doubleacute is definitely a front mid rounded vowel. Specifically, a long front mid rounded vowel, as Hungarian has fully phonemic vowel length.

Introducing /run

Posted Mar 30, 2011 18:57 UTC (Wed) by jengelh (subscriber, #33263) [Link]

There was no o-double-acute in that list. That is an o-with-tilde, though it looks damn similar to o-double-acute at the websqueezed fonts of 12pt and below.

Introducing /run

Posted Mar 30, 2011 19:11 UTC (Wed) by Trelane (subscriber, #56877) [Link]

it was just a list of letters I could easily access using the Compose key. :)

Introducing /run

Posted Mar 30, 2011 18:07 UTC (Wed) by Slumberthud (subscriber, #45657) [Link]

Pronunciation, please.

Introducing /run

Posted Mar 30, 2011 18:21 UTC (Wed) by mezcalero (subscriber, #45103) [Link]

Like Goethe, just without the "G" and the "the". And with a "P" and a "ttering" instead.

Introducing /run

Posted Mar 30, 2011 18:30 UTC (Wed) by dark (guest, #8483) [Link]

oePttering? Now I'm confused :(

Introducing /run

Posted Mar 30, 2011 23:32 UTC (Wed) by baldridgeec (guest, #55283) [Link]

The way I've always heard "Goethe" pronounced (which may be 100% wrong - neither I nor any of my friends speak Enlightenment-era Germanic) it would end up sort of like:
"Puh(r)-turing" -- with the "(r)" being a soft slur into the next syllable.

Leonard, is that about right? Or do I need to try to start bringing Goethe into conversation more often so I can correct peoples' pronunciation? :)

Introducing /run

Posted Mar 31, 2011 2:15 UTC (Thu) by mezcalero (subscriber, #45103) [Link]

Not right, no. The "oe" sounds like "ö", which sounds like a mixture between "o!" and "e!"

Introducing /run

Posted Mar 31, 2011 2:21 UTC (Thu) by baldridgeec (guest, #55283) [Link]

Oh wow, that's way off...

Do the exclamation points as pronunciation guides mean the same thing they do in Ndebele?

(sorry, couldn't resist -- but seriously... I now have no idea how to pronounce Goethe. To Wikipedia!)

Introducing /run

Posted Oct 20, 2017 9:42 UTC (Fri) by poruid (guest, #15924) [Link]

In Dutch "oe" is pronounced as the German "U" and really, it sounds a lot better than the English "u".

Introducing /run

Posted Mar 30, 2011 20:54 UTC (Wed) by nix (subscriber, #2304) [Link]

This is why we should support Unicode: so that a nice clear notation like the International Phonetic Alphabet could be used for this.

That way, Lennart could describe the pronunciation of his name using freaky-looking symbols that nobody knows how to pronounce, increasing global confusion still further. Surely a worthy goal.

Introducing /run

Posted Mar 31, 2011 0:29 UTC (Thu) by ewan (subscriber, #5533) [Link]

Clearly the correct solution is a sound sample saying "Hi, I'm Lennart Poettering, and I pronounce Poettering 'Poettering'" bundled in with the systemd source.

Introducing /run

Posted Mar 31, 2011 0:58 UTC (Thu) by dmarti (subscriber, #11625) [Link]

Or it could be a libcanberra sample application.

Introducing /run

Posted Oct 20, 2017 15:56 UTC (Fri) by karkhaz (subscriber, #99844) [Link]

Linus did it the right way by giving an interview about it

https://www.youtube.com/watch?v=5IfHm6R5le0

Introducing /run

Posted Mar 30, 2011 15:50 UTC (Wed) by ovitters (guest, #27950) [Link]

Could you please troll somewhere else? Thanks.

Introducing /run

Posted Mar 30, 2011 17:21 UTC (Wed) by rwmj (subscriber, #5474) [Link]

The original post isn't a troll.

It's true that systemd replaces shell init scripts with C, and it's at least arguable that the C code will be more buggy than the shell scripts.

The question though is whether it matters that the shell scripts are replaced with C.

After all, you weren't really supposed to edit those init scripts, and they were written in a highly formulaic variety of shell with lots of canned functions. It was very easy to make mistakes in those shell scripts, and keeping them all up to date with the latest LSB/init standards was a constant battle.

Instead of editing those shell scripts, you should use /etc/sysconfig to make changes to how daemons start up.

Furthermore, systemd AIUI can use init scripts if you want to.

Introducing /run

Posted Mar 30, 2011 17:26 UTC (Wed) by rahulsundaram (subscriber, #21946) [Link]

"The original post isn't a troll."

Certainly silly to get all railed up and call Lennart a troll for being a messenger in a widely agreed upon and sensible change. The other criticism happens to be invalid as well as you have pointed out.

Introducing /run

Posted Mar 30, 2011 17:53 UTC (Wed) by dcg (subscriber, #9198) [Link]

IMO it's not correct to say that the shell scripts have been replaced with C. The logic of the init system has certainly been rewritten in C. Some daemons have been modified to be able to be run without needing to do any shell parsing (and I don't understand why it would be a bad thing). But what dictates the behaviour of the init process is not C code, but configuration files. So, most of the real meat of the init system has not been rewritten in C code, but "systemd configuration code". Which are easily hackable...

Introducing /run

Posted Mar 31, 2011 2:12 UTC (Thu) by k8to (guest, #15413) [Link]

The problems are:

- it is not a widely agreed upon change
- it makes the system markedly worse according to the inspectability axis

Introducing /run

Posted Mar 31, 2011 16:54 UTC (Thu) by vonbrand (guest, #4458) [Link]

Please...

  • Major distributions have adopted/are considering it (Fedora, Debian, OpenSUSE at least)
  • "Inspectable" for whom? The maze of shell scripts legated by sysvinit isn't exactly transparent... Sure, systemd does get some using to, but from my (rabid Fedora fan, rawhide follower; and thus user for some time now) perspective it's much better than what came before; plus is promises to really handle dependencies, not just "(try to) start this after that one on boot, and hope for the best" ordering.

Introducing /run

Posted Apr 1, 2011 3:57 UTC (Fri) by motk (subscriber, #51120) [Link]

O_o ~= my face when tangled knots of SYSV shell are described as 'inspectable', ignoring the rampant emergent complexity and entropy therein.

Introducing /run

Posted Mar 30, 2011 18:47 UTC (Wed) by aliguori (subscriber, #30636) [Link]

It's true that systemd replaces shell init scripts with C, and it's at least arguable that the C code will be more buggy than the shell scripts.

I think that's a simplification of what systemd does and puts too much importance on language which I think is really just an implementation detail here. My understanding of systemd is that it eliminates the explicit dependency expressed in most init systems with an implicit one largely by using file descriptor inheritance.

Since most tools really don't depend on an application to be running, but just depend on being able to open a socket, you can tremendously simplify the problem by making all of the sockets available at once and starting pretty much everything in parallel.

Since startup dependencies are now simplified so greatly, the per task startup is simplified so much that for the most part, it's trivial to do it all with just plain C.

So a better way to think of it is that systemd doesn't replace init scripts with C, it fundamentally eliminates the need to have init scripts by tremendously simplifying the problem of starting up tasks with complex dependency hierarchies.

Introducing /run

Posted Mar 30, 2011 20:31 UTC (Wed) by vonbrand (guest, #4458) [Link]

I think that's a simplification of what systemd does and puts too much importance on language which I think is really just an implementation detail here. My understanding of systemd is that it eliminates the explicit dependency expressed in most init systems with an implicit one largely by using file descriptor inheritance.

Make that no dependencies and we'll agree (The standard init stuff just says in which order stuff should (!) be (tried to) run when the system starts in a given runlevel, nothing more. Fragile as hell, but even so vastly better than what came before...).

Introducing /run

Posted Mar 30, 2011 23:42 UTC (Wed) by rgmoore (✭ supporter ✭, #75) [Link]

I'm not sure that's a fair description of what systemd does. The biggest thing it does is to refactor the init system. It takes the boilerplate part of all the init scripts and combines it into a single implementation in C, and turns the small variable part into config files. Eliminating the copy and paste proliferation of independent init files should tend to reduce bugs, not increase them.

Introducing /run

Posted Mar 30, 2011 16:55 UTC (Wed) by drag (guest, #31333) [Link]

> And the developers applaud and follow him like mindless sheep.

I hope so. Linux is better because of it.

Introducing /run

Posted Mar 31, 2011 2:06 UTC (Thu) by JEDIDIAH (guest, #14504) [Link]

>> And the developers applaud and follow him like mindless sheep.
>
> I hope so. Linux is better because of it.

No. This is just change for it's own sake like a lot of the stuff that's been going on lately (Wayland, Unity). This seems to be about people's aesthetic preferences and really has little functional value.

Introducing /run

Posted Mar 31, 2011 2:18 UTC (Thu) by Trelane (subscriber, #56877) [Link]

Disagree completely. It's demonstrably false that it's just "change for it's own sake"; read the comments in this read regarding read-only /.

I'd love to be able to run with / being on read-only media in some scenarios. (I'm a paranoid guy. :)

Introducing /run

Posted Mar 31, 2011 4:44 UTC (Thu) by AndreE (guest, #60148) [Link]

yeah there is no practicle reason for wanting to reduce the size of tmpfs and to stop random non-device crap being written in /dev.

Why don't you start jumping up and down about all the stuff that broke the unix best practices that necessitated /run ?

Introducing /run

Posted Mar 31, 2011 5:06 UTC (Thu) by drag (guest, #31333) [Link]

> No. This is just change for it's own sake like a lot of the stuff that's been going on lately (Wayland, Unity). This seems to be about people's aesthetic preferences and really has little functional value.

Well change is good. It is just people doing their best to make something they like better.

And aesthetics do matter. Isn't that part of the hacker ethos? There is certain aesthetic quality to the design of Unix, right?

The world moves on, things change, people adapt.

Like this /run thing...

Were not people flipping apeshit just a while ago about how SystemD flashed a warning that having a separate /usr is a unsupported configuration?

And how, in reality, that was not a supported configuration for years and years. It can work, but it's not guaranteed to work. You can make it work even if it didn't... but it would require inelegant solutions.

But now when the same guy says that we should have a /run directory so that programs always have a place to store their runtime temporary files... so people can have /var mounted on a different partition without a bunch of ugly hacks going on in /dev/.??* files... now all of a sudden that is a horrible suggestion.

What is the alternative? Just keep shoving more and more information into /dev/.??* because that is the only file system that developers know will be there at immediate boot-up?

Maybe if we modify things a bit and try to improve the system then we can finally have a system that really does support things like read-only root and remote-mount /usr/* directories.

Oh. And Unity is not-so-hot. Ubuntu is pushing too hard on it and it needs to wait till next release. I tried using it for a few weeks, but it's just not a very pleasant experience.

So I ditched Ubuntu and went with Fedora 15 Alpha. I tried to go back to Debian first, but I couldn't get it to work the way I wanted. Gnome 3 is just not well enough put together for Debian yet.

Fedora is FANTASTIC. Gnome 3 has been stable for me. Open source Gallium Radeon drivers are fast and can actually play most games now. The bug track stuff that Fedora has built in to help file bug reports on application crashes is super-duper cool. Hopefully it won't take much longer to get codec acceleration (maybe 8-10 months if things go well) and then I would be very happy.

I wouldn't be so negative about change if I was you. It has it's ups and downs. Ideally it will have more ups.

Introducing /run

Posted Apr 1, 2011 3:59 UTC (Fri) by motk (subscriber, #51120) [Link]

There's always slackware if you want to live in 1999 Linuxland. Or NetBSD, perhaps.

Introducing /run

Posted Mar 30, 2011 17:13 UTC (Wed) by vrfy (guest, #13362) [Link]

> And the developers applaud and follow him like mindless sheep

It's actually a whole group a sheep that just constantly moves on. It's the group who does the work, and who needs solutions to make the real things happen.

The mindless complainers on the other hand, their impact is close to zero in the end.

Introducing /run

Posted Mar 30, 2011 17:34 UTC (Wed) by wahern (subscriber, #37304) [Link]

Most init.d scripts were buggy as hell. When I write my daemon code I always include command line arguments to specify PID, config, chroot, and log paths and all the other options that cannot be done easily or safely outside of the actual daemon itself. Inevitably someone would come along and rewrite my very simple init.d script (which simply forwarded options to the actual daemon to be done *properly*) to use the inherently broken init.d shell function libraries of various distributions.

I'm not the biggest fan of systemd because it's yet another incompatible daemon manager (compare OS X launchd, Solaris SMF, daemontools... and OpenBSD is just *now* moving to rc.d scripts for ports!) But in most ways it's an improvement over the _existing_ init.d systems. init.d itself isn't broken, IMO, but Redhat especially--other distros, too--made it broken by trying to use it to paper over all the deficiencies in other people's broken code, rather than *fixing* the broken code.

Introducing /run

Posted Mar 30, 2011 17:36 UTC (Wed) by dcg (subscriber, #9198) [Link]

1) A lot of code in the init scripts is not "easily hackable", it's a mess. Shell script usually gets very ugly when you use it to program things that don't involve combining unix commands.
2) You can use shell scripts with systemd. It's even more configurable than the old init scripts.

Introducing /run

Posted Mar 30, 2011 18:03 UTC (Wed) by jmorris42 (guest, #2203) [Link]

I know I'm feeding a troll by replying here.... but as someone who as himself flamed Lennart Poettering over PulseAudio, systemd and his general hostility to the 'UNIX Way' I want to be sure to stand up and applaud when he is right. And /run is right.

/run leads to a simpler and more understandable system and that is the UNIX Way.

Introducing /run

Posted Mar 30, 2011 20:07 UTC (Wed) by aleXXX (subscriber, #2742) [Link]

Same here.
Sounds like a good and clean thing.

Alex

Introducing /run

Posted Mar 30, 2011 20:56 UTC (Wed) by nix (subscriber, #2304) [Link]

As another perennial Lennart critic who oscillates between thinking his code is really neat and thinking his code is in somewhat bad taste, strongly seconded. This was not stupid. ;}

Introducing /run

Posted Jun 19, 2011 22:46 UTC (Sun) by Yaro (guest, #75783) [Link]

Yeah, I don't like Lennart, either. systemd can't properly init its way out of a paper bag (At least the "ancient" SysVInit can reliably make sure your partitions are mounted properly from the fstab. systemd couldn't even do that for me.) and PA breaks sound just about everywhere it's used.

Ever notice how, whenever someone calls for him to fix PA's problems, he blames it on either ALSA, drivers, or distributions? It's that sort of passing the blame on problems with their software that makes the maintainer of glibc so unpopular.

Introducing /run

Posted Mar 30, 2011 20:22 UTC (Wed) by job (guest, #670) [Link]

You should be happy this is Poettering and not de Icaza. Imagine what fun systemd would be to implement in C#/Mono. If it's good enough for the note taking app, it's good enough for init! That would be a better troll by an order of magnitude!

Introducing /run

Posted Mar 30, 2011 23:51 UTC (Wed) by baldridgeec (guest, #55283) [Link]

I like most of Leonard Poettering's work. I still haven't made up my mind about systemd, but I love Pulseaudio! (at least when it works properly... which happens so much more often these days than it used to!)

I never had a broken sound card that wouldn't multiplex with ALSA, but I do believe it happened, and then I saw EarCandy - that was really the "critical app" that demonstrated the usefulness of Pulse to me. And the recent versions get out of the way of jackd automatically... good stuff.

Introducing /run

Posted Mar 31, 2011 4:40 UTC (Thu) by AndreE (guest, #60148) [Link]

I agree. I prefer buggy and unmaintainable shell code

"Flame away!"

Posted Mar 30, 2011 17:30 UTC (Wed) by cesarb (subscriber, #6266) [Link]

This email was very interesting. Every objection I had while reading it was addressed a bit later on the same email ("another bind mount? that makes the output of the mount command even harder to read" - reads a bit more - "For F16 [...] will become symlinks", for instance). It turned my initial annoyance at seeing the change in systemd.git ("/run" sounded wrong, perhaps because it has been "/var/run" since forever, and because adding new files or directories directly in the root always feels a bit dirty) into a belief that it can be a worthwhile change. I could see nothing left to flame about it.

It is great that we have people willing to do what is needed to enhance the Linux infrastructure, without being afraid of the predictable and unavoidable controversy.

And I am thankful to Corbet for posting this email here. Without seeing it, I would still be thinking "what an ugly change!".

"Flame away!"

Posted Mar 30, 2011 17:36 UTC (Wed) by vrfy (guest, #13362) [Link]

> For F16 [...] will become symlinks", for instance

If you want, you can do this manually already today. Systemd copes just fine with that, and it gets rid of the two bind mounts. See the details here:
http://cgit.freedesktop.org/systemd/commit/?id=2b583ce657...

"Flame away!"

Posted Mar 30, 2011 17:48 UTC (Wed) by cesarb (subscriber, #6266) [Link]

It is one thing me being able to do it (this is Linux, we are always able to do anything we want by editing some source code somewhere and recompiling).

It is another thing it being done by default, with thousands of people "testing" it (most people will see no need to change from the default), and with every thirdy-party program having to deal with it, with even obscure breakage caused by it being found sooner or later.

Do not underestimate the power of defaults.

"Flame away!"

Posted Mar 30, 2011 18:39 UTC (Wed) by vrfy (guest, #13362) [Link]

That will happen, sure. Actually, the installer of a system should do that today already.

It's just not entirely trivial to change that on the running system during a package update, but we will get there.

"Flame away!"

Posted Apr 1, 2011 3:45 UTC (Fri) by elanthis (guest, #6227) [Link]

It's not trivial (or even possible) to do a lot of things on a package update on a running system. It's utterly impossible to safely remove or replace an ABI-unstable shared library that is dynamically loaded by running applications, for instance. The only way to do that safely is to queue up the change until the next reboot, and then shuffle the files around then.

There's a _reason_ Windows requires a reboot for many updates.

(Windows fails in that it used to just require a reboot for everything out of laziness, which made it incredibly annoying to update all those things for which a reboot was totally unnecessary. It's a lot better about that these days. Many application vendors still demand reboots after their app installs, but those are generally ignorable and are not Windows' fault.)

"Flame away!"

Posted Apr 2, 2011 12:28 UTC (Sat) by kleptog (subscriber, #1183) [Link]

Umm, couldn't you just provide the new libraries under a new name? There is a question of when to delete the old files, but that's why having parallel installs of different versions is a good idea.

Introducing /run

Posted Mar 30, 2011 17:45 UTC (Wed) by martinfick (subscriber, #4455) [Link]

Could /tmp just become a link to /run/tmp then?

Introducing /run

Posted Mar 30, 2011 18:19 UTC (Wed) by rleigh (guest, #14622) [Link]

/run may well have much a smaller size than /tmp, and they have rather different purposes. /run will typically contain small files (pidfiles, lockfiles, other small bits of system state etc.) while /tmp is intended to contain arbitrary user data, which may be significantly larger.

Keeping them separate also means users can't DoS the system by using all the space/inodes and thus prevent the creation of new pidfiles/lockfiles etc.

Regards,
Roger

/tmp and /var/tmp

Posted Mar 30, 2011 19:01 UTC (Wed) by dmarti (subscriber, #11625) [Link]

The other problem is /var/tmp, which is now just an extra /tmp that doesn't deserve its own tmpfs, but that some software wants to use. SELinux complains about if you make it a symlink to ../tmp. Bind mount it to /tmp in /etc/fstab?
tmpfs			/tmp			tmpfs	defaults	0 0
/tmp			/var/tmp		tmpfs	bind		0 0
tmpfs as many places as possible FTW.

/tmp and /var/tmp

Posted Mar 30, 2011 19:49 UTC (Wed) by makomk (guest, #51493) [Link]

Putting /var/tmp/ is on a tmpfs not just a violation of the LSB filesystem layout requirements, it's likely to lead to data loss. /var/tmp/ is required to be preserved across reboots.

/tmp and /var/tmp

Posted Mar 30, 2011 19:56 UTC (Wed) by dmarti (subscriber, #11625) [Link]

But it's allowed to be cleaned out, like any temp directory, right? I don't reboot often enough that a "tmpwatch" or cron job would run any less often than a reboot.

Any examples of programs that put something important in there?

/tmp and /var/tmp

Posted Mar 30, 2011 20:59 UTC (Wed) by nix (subscriber, #2304) [Link]

Original vi / nvi puts files in there for use by virecover. You really want those to still be there after e.g. a power cut.

(TBH I much prefer this over the vim habit of scattering .swp files everywhere. Emacs has a similar feature: you can drop all autosave files into a single directory without much effort.)

/tmp and /var/tmp

Posted Mar 30, 2011 21:18 UTC (Wed) by cortana (subscriber, #24596) [Link]

And for those who are wondering, you can set vim's 'directory' option to '/var/tmp' to get this behaviour back.

/tmp and /var/tmp

Posted Apr 1, 2011 17:28 UTC (Fri) by nix (subscriber, #2304) [Link]

Oo, thanks, hadn't noticed that. It doesn't record the pathname anywhere, though, so collisions are quite likely. (Emacs and XEmacs encode the pathname in the autosave filename.)

/tmp and /var/tmp

Posted Apr 1, 2011 19:13 UTC (Fri) by dtlin (subscriber, #36537) [Link]

:h dir
	- For Unix and Win32, if a directory ends in two path separators "//"
	  or "\\", the swap file name will be built from the complete path to
	  the file with all path separators substituted to percent '%' signs.
	  This will ensure file name uniqueness in the preserve directory.
(Same with 'bdir'.)

/tmp and /var/tmp

Posted Mar 31, 2011 12:38 UTC (Thu) by NAR (subscriber, #1313) [Link]

On the other hand if I edit a file on NFS from one computer, then vim can't use the /var/tmp from an other computer...

/tmp and /var/tmp

Posted Mar 30, 2011 21:06 UTC (Wed) by fritsd (guest, #43411) [Link]

Doesn't vi use /var/tmp for its crash-recovery files?

/tmp and /var/tmp

Posted Mar 30, 2011 21:12 UTC (Wed) by nybble41 (subscriber, #55106) [Link]

Tools like tmpwatch remove *old* temporary files; a reboot could potentially wipe out *recent* files which still contain needed data.

That said, I don't specifically know whether any common programs store data in /var/tmp which must persist across a reboot. I do know that MySQL occasionally stores certain temporary files there; these may be need for recovery after a crash or power interruption. KDE also stores cache files under /var/tmp; losing these at every reboot would be likely to negatively impact performance.

/tmp and /var/tmp

Posted Mar 31, 2011 0:02 UTC (Thu) by nicooo (guest, #69134) [Link]

Shouldn't they be using /var/cache?

/tmp and /var/tmp

Posted May 4, 2011 21:36 UTC (Wed) by nix (subscriber, #2304) [Link]

KDE rebuilds those cache files at every startup anyway.

/tmp and /var/tmp

Posted Mar 30, 2011 19:59 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link]

In a couple of cases I've used /tmp to hold several hundred gigabytes of data. I don't think tmpfs can cope with such usage.

/tmp and /var/tmp

Posted Mar 30, 2011 20:27 UTC (Wed) by Darkmere (subscriber, #53695) [Link]

/tmp tends to be the place where things like webbrowsers store movies you cache and download... with the advent of HD video streaming, these can be interestingly large.

/tmp and /var/tmp

Posted Mar 30, 2011 23:36 UTC (Wed) by roblucid (guest, #48964) [Link]

100's of GB in /tmp, that's GUI error (Gross User Incompetence) or just bad taste if you prefer.

/tmp is meant to be small, fast and ephemeral, with a purge across a reboot being acceptable or clean out if the file's not accessed for a day or so.

Of course if you *must* have a /tmp/humungeous then nothing to stop a mount under /tmp, or a symlink to fallow area, for you to fill.

/tmp and /var/tmp

Posted Mar 31, 2011 2:20 UTC (Thu) by k8to (guest, #15413) [Link]

1 - tmp is not meant to be small, it is meant to be temporary, it is only broken unixes which used special filessytems for tmp which could not support large temporary files, which do exist

2 - on Linux, at least (this is LWN) there is little advantage of tmpfs over a normal filesystem for tmp. Linux's filesystem layer is quite good about not needing to send out data to disk when unnecessary (a truly shortlived file may never see the disk at all), and for the longer lived or large file case you get perfectly reasonable behavior as well

/tmp and /var/tmp

Posted Mar 31, 2011 21:36 UTC (Thu) by jond (subscriber, #37669) [Link]

Absolutely. And I've seen veteran UNIX sysadmins dump e.g. Oracle install data in /tmp on solaris systems, which *do* use tmpfs for /tmp, thus knackering the box... it's expected to be able to do it, even when it isn't a good idea :-)

/tmp and /var/tmp

Posted Mar 31, 2011 12:57 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link]

That 100GB were for intermediate data in video processing. They are put in /tmp by default.

And why shouldn't they?

/tmp and /var/tmp

Posted Mar 31, 2011 17:00 UTC (Thu) by vonbrand (guest, #4458) [Link]

Because /tmp is supposed to be off-limits for users, it being the place for system temporaries?

/tmp and /var/tmp

Posted Mar 31, 2011 17:54 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link]

Whiskey Tango Foxtrot?

Sticky bit for directories was specifically invented for the world-writable /tmp. Also, where should user processes store their temporary data (for example, if a user opens a .tgz file in Nautilus)?

/home might be on a slow NFS link, so it's an incorrect answer.

/tmp and /var/tmp

Posted Mar 31, 2011 19:43 UTC (Thu) by vonbrand (guest, #4458) [Link]

The user temporary files are supposed to go in /var/tmp

/tmp and /var/tmp

Posted Mar 31, 2011 19:56 UTC (Thu) by martinfick (subscriber, #4455) [Link]

Where do you get that rationale from? The FHS does not think so:

  • /tmp : Temporary files Purpose

      The /tmp directory must be made available for programs that require temporary files. Programs must not assume that any files or directories in /tmp are preserved between invocations of the program. Tip Rationale

      IEEE standard P1003.2 (POSIX, part 2) makes requirements that are similar to the above section. Although data stored in /tmp may be deleted in a site-specific manner, it is recommended that files and directories located in /tmp be deleted whenever the system is booted.

      FHS added this recommendation on the basis of historical precedent and common practice, but did not make it a requirement because system administration is not within the scope of this standard.

  • /var/tmp : Temporary files preserved between system reboots Purpose
    • The /var/tmp directory is made available for programs that require temporary files or directories that are preserved between system reboots. Therefore, data stored in /var/tmp is more persistent than data in /tmp. Files and directories located in /var/tmp must not be deleted when the system is booted. Although data stored in /var/tmp is typically deleted in a site-specific manner, it is recommended that deletions occur at a less frequent interval than /tmp.

    /tmp and /var/tmp

    Posted Apr 1, 2011 15:55 UTC (Fri) by k8to (guest, #15413) [Link]

    If /tmp was not for users, then the sticky bit would not have been added to unix to specifically support /tmp for users.

    /tmp and /var/tmp

    Posted Apr 1, 2011 17:30 UTC (Fri) by nix (subscriber, #2304) [Link]

    Uh, GCC dumps stuff in /tmp if you don't specify -pipe. Is the compiler something normal users shouldn't run now?

    (FWIW I too have never heard this before. /tmp is transient: /var/tmp is not. That's all.)

    /tmp and /var/tmp

    Posted Apr 2, 2011 15:15 UTC (Sat) by vonbrand (guest, #4458) [Link]

    The compiler is not a "normal user", it is a system program (run by normal users under their UID, thus the sticky bit on /tmp).

    /tmp and /var/tmp

    Posted Apr 2, 2011 17:11 UTC (Sat) by mpr22 (subscriber, #60784) [Link]

    1) I notice you're still not bothering to provide a citation for "/tmp is for the system and off-limits to ordinary applications".

    2) In my world, the C compiler is an ordinary user application, so should use filesystems in the manner appropriate to ordinary user applications.

    /tmp and /var/tmp

    Posted Mar 31, 2011 13:43 UTC (Thu) by jschrod (subscriber, #1646) [Link]

    GUI judgement is gross arrogance, or just bad human judgement if you prefer.

    In my world, if one uses applications that place there temporary files in /tmp and produce several GBs of them, it is surely *not* gross user incompetence if one decides not to spend one's time trying to detect how each and every of these apps can be persuaded to place their temporary files somewhere else. Instead one just gives /tmp more space. In my world, this is called pragmatic. Maybe you've heard of that term, but with your quick judgement of others, there is some doubt about that.

    Maybe that information is new, but setting aside a few hundred GBs of disk space for /tmp is not really a problem with today's disk sizes. The 90s are over, really. And in no way that stops /tmp from being purged at reboot time.

    Btw, if I would really clean out every day all /tmp files not accessed in a day, my desktop would not function any more. /tmp cleaning while user sessions are active needs more care than such coarse treatments; it needs blacklists, and most often also longer retention times.

    /tmp and /var/tmp

    Posted Apr 1, 2011 21:23 UTC (Fri) by Wol (subscriber, #4433) [Link]

    tmpfs can cope with huge amounts of data no problem.

    BUT it *defaults* to "half available ram".

    I got bitten by this when I put /var/tmp into tmpfs on gentoo, and then wondered why OpenOffice wouldn't compile :-)

    I always set swap to (at least) twice available ram, which on my system is 32Gb (kernel 2.4 proved that the "twice ram" rule was NOT obsolete, and nobody has yet given me any reason to believe things have changed since then).

    I think my tmpfs partitions are all set to about 10-16Gb in size. They're all fine. If you use enough space on the partition, it will simply spill into swap.

    Cheers,
    Wol

    /tmp and /var/tmp

    Posted Apr 2, 2011 14:28 UTC (Sat) by dtlin (subscriber, #36537) [Link]

    Spinning disk filesystems try hard to keep data contiguous; swap does a relatively poorer job of it. So if you're constantly swapping your tmpfs, it's likely slower than if you just used a dedicated filesystem.

    /tmp and /var/tmp

    Posted Apr 2, 2011 23:05 UTC (Sat) by Wol (subscriber, #4433) [Link]

    :-)

    But with 8Gb of ram, my system hardly ever swaps, even with /tmp as tmpfs.

    However, portage occasionally chews up large amounts of temporary space. Compiling OOo, it recommends you have 10Gb of disk space free in /var/tmp/portage. Chances are, if anything ever gets flushed to swap, it'll never be wanted again, which is why I stick it in tmpfs rather than have it chew up real space in a real partition.

    And with 1.5Tb disk across two drives, why should I care about losing 32Gb to swap? :-) It's there if it's needed - which it hardly ever is.

    Cheers,
    Wol

    You 100% right - and still wrong :-)

    Posted Apr 3, 2011 14:59 UTC (Sun) by khim (subscriber, #9252) [Link]

    Yes, if you're constantly swapping your tmpfs you are slowing everything down. But more often then not it's not the case. 80/20> rules is valid for temporary files too. Most temporary files are accessed rarely, but few are accessed constantly - and they don't ever hit the disk with tmpfs. I know that incremental Chromium build is faster on tmpfs then on real fs if you have beefy system (16GB of RAM, 100GB of temporary files in tmpfs).

    /tmp and /var/tmp

    Posted Apr 1, 2011 20:48 UTC (Fri) by nicooo (guest, #69134) [Link]

    The OpenBSD man page for hier makes the difference clearer.

    Introducing /run

    Posted Mar 31, 2011 13:29 UTC (Thu) by jschrod (subscriber, #1646) [Link]

    Please not: My desktop's main memory (8 GB) would not be sufficient to hold /tmp. Using tmpfs for /tmp is not a given.

    Introducing /run

    Posted Mar 30, 2011 19:27 UTC (Wed) by dowdle (subscriber, #659) [Link]

    I was really hoping for a /runlolarun directory but maybe next time.

    Introducing /run

    Posted Mar 30, 2011 19:45 UTC (Wed) by Trelane (subscriber, #56877) [Link]

    The problem with that would be that you couldn't then see the Forrest for the directory trees.

    Introducing /run

    Posted Mar 30, 2011 19:48 UTC (Wed) by einstein (guest, #2052) [Link]

    > I was really hoping for a /runlolarun directory but maybe next time.

    +1 funny

    Introducing /run

    Posted Mar 30, 2011 21:26 UTC (Wed) by teknohog (guest, #70891) [Link]

    /yohohoandabottleofrun

    Introducing /run

    Posted Mar 31, 2011 13:26 UTC (Thu) by jubal (subscriber, #67202) [Link]

    No-one stops you from using /run/lola/run, which is also a little bit less convoluted. (A great film, that.)

    Introducing /run

    Posted Mar 30, 2011 20:12 UTC (Wed) by neilbrown (subscriber, #359) [Link]

    I'm so happy about this...

    mdadm really needs somewhere that persists from early boot. I tried /lib/init/rw first but that is Debian only and doesn't exist before '/' is mounted. I ended up sticking it in /dev/.mdadm but I really hated doing that. I don't believe in hidden directories any more than I believe in keeping secrets.

    But /run/mdadm is the perfect answer.

    Thanks.

    Introducing /run

    Posted Mar 30, 2011 22:33 UTC (Wed) by hmh (subscriber, #3838) [Link]

    We would have been glad to add /lib/init/rw support in the initramfs if we knew you needed it for mdadm, I guess.

    But now we can all work on /run. It is better that way, indeed.

    Introducing /run

    Posted Mar 30, 2011 20:43 UTC (Wed) by pyellman (guest, #4997) [Link]

    I have to ask: if /run is for runtime data, why not call it /runtime? I guess the same goes for /dev (devices), but certainly, calling it /run instead of the more specific and accurate /runtime seems potentially particularly misleading to a "novice"; I certainly won't blame anyone who doesn't already know for thinking this is where things go that you want to 'run'. I mean, if it was "runnable scripts" vs "run", I could see the point, but "run" vs "runtime"? What's with the obsession with saving a couple of characters/keystrokes? Appreciate honest answers.

    Introducing /run

    Posted Mar 30, 2011 20:58 UTC (Wed) by jrn (subscriber, #64214) [Link]

    It makes life easier for people already familiar with /var/run. Hope that helps.

    Introducing /run

    Posted Mar 30, 2011 21:03 UTC (Wed) by nix (subscriber, #2304) [Link]

    It's because it's /var/run, only moved to the root filesystem. Why was that not called 'runtime'? Ask the ancient Unix gurus, but since they were plainly obsessed with saving individual characters come what may (e.g. 'creat()') I think the answer can be predicted in advance.

    Machines were small in those days. 'runtime' uses four more bytes than 'run'. It may be that simple.

    Introducing /run

    Posted Mar 30, 2011 21:43 UTC (Wed) by drag (guest, #31333) [Link]

    Your less likely to typo with three letters then with 7.

    Try typing /etc /etc /etc /etc as fast as you can.
    Now try it again with /et_cetera :)

    Introducing /run

    Posted Mar 30, 2011 22:16 UTC (Wed) by andrel (guest, #5166) [Link]

    It's the same three keystrokes either way: /,e,tab

    Introducing /run

    Posted Mar 30, 2011 22:44 UTC (Wed) by drag (guest, #31333) [Link]

    You are obviously not using the same shell that people did when they came up with the names.

    Anyways... /runtime is no more illustrative of the purpose of the directory then /run.

    Introducing /run

    Posted Mar 31, 2011 2:44 UTC (Thu) by pyellman (guest, #4997) [Link]

    The term 'runtime' appears regularly as the key word in the explanation of this directory's purpose.

    Introducing /run

    Posted Mar 31, 2011 21:39 UTC (Thu) by jond (subscriber, #37669) [Link]

    Quite, and "because it was called /var/run before" does not strike me as a good reason to keep doing it. Or we wouldn't be tinkering with the contents of / in the first place :-) This could be a golden opportunity to introduce some meaningful names into the filesystem, in the era of tab-completion.

    Introducing /run

    Posted Mar 31, 2011 2:32 UTC (Thu) by pyellman (guest, #4997) [Link]

    I tried it before asking, and actually, for run vs runtime, I find little difference, even without tab completion.

    Introducing /run

    Posted Mar 30, 2011 22:08 UTC (Wed) by josh (subscriber, #17465) [Link]

    Four bytes have little to do with it; /runtime would take four extra *keystrokes*. (Though with modern completion systems, you can type either as /ru[tab] in many cases.)

    Introducing /run

    Posted Mar 30, 2011 23:51 UTC (Wed) by nicooo (guest, #69134) [Link]

    /var/run
    /runtime
    :)

    Introducing /run

    Posted Mar 31, 2011 19:49 UTC (Thu) by vonbrand (guest, #4458) [Link]

    Re creat(2), I head a story sometime that the length of identifiers in the assembler was limited to 6, and that the compiler added a '_' in front of user identifiers to distiguish them from all sort of internal names used by the compiler and assembler (that was still that way with the C compiler in BSD 4.2 I used around 1985...), thus _creat at 6 characters, user-visible name creat with 5.

    Introducing /run

    Posted Mar 31, 2011 20:19 UTC (Thu) by dark (guest, #8483) [Link]

    The length limit of 6 leaves just enough space for a colon and a tab, and then the code after the label aligns with all the other code.

    I don't know if that's the actual reason :)

    Introducing /run

    Posted Apr 1, 2011 17:32 UTC (Fri) by nix (subscriber, #2304) [Link]

    Yes indeed. Levine mentions this in _Linkers and Loaders_, a book full of gold dust about ancient systems (and a lot of stuff applicable to new ones too).

    Introducing /run

    Posted Mar 30, 2011 21:09 UTC (Wed) by martinfick (subscriber, #4455) [Link]

    Unix is like math. Despite what your programming teacher may have taught you, shorter names are actually easier to grok for most things, variables and directories included. Ever wonder why algebra and physics is still taught using x, y, v, s and not unknownNumber, mySpeed, distance... Because it is easier to read, not just to type or write.

    The root directories are common directories that everyone familiar with unix should know, these are not obscure directories that you see once while investigating a deep application sub directory and wonder what it is. It makes sense to make the common easier for the experienced users and not the newcomers. Newcomers will ask once and then remember, in the mean time, the rest of us can benefit from short simple directory listings and paths. This is not elitism, this is simply better usability.

    Introducing /run

    Posted Mar 30, 2011 22:59 UTC (Wed) by dskoll (subscriber, #1630) [Link]

    +1

    I hate the occasional times I have to use a Windoze box and deal with monstrosities like C:\Program Files\Some Stupid Vendor Name\Some Huge Directory Name

    And in my (mercifully) brief encounter with Mac OS X, I was similarly disgusted by its reworking of the standard UNIX directory layout into a verbose user-friendly [sic] horror.

    Introducing /run

    Posted Mar 31, 2011 6:04 UTC (Thu) by frazier (guest, #3060) [Link]

    In MS Windows, I end up using "C:\progra~1\" in my paths more often than I'd like to admit to.

    Introducing /run

    Posted Mar 31, 2011 16:40 UTC (Thu) by zlynx (guest, #2285) [Link]

    You don't open up cmd and run fsutil immediately after a fresh Windows install and speed tweak all the options?

    You've got to make sure TRIM is on and 8.3 names are off and last-accessed is off and you might like to tweak the memory buffers if you've got gobs of RAM.

    With 8.3 names off, C:\program~1 fails to work, but at least NT stops reminding me of DOS.

    Introducing /run

    Posted Mar 30, 2011 21:29 UTC (Wed) by janfrode (subscriber, #244) [Link]

    The first thing that popped to mind when I saw the announcement from Lennart was that this would be something like daemontools /service directory. I.e. put something there and it will be started/superviced.

    /runtime would have been much clearer.

    Introducing /run

    Posted Mar 30, 2011 22:06 UTC (Wed) by neilbrown (subscriber, #359) [Link]

    I would have preferred "/bikeshed" myself, but the secret cabal made the behind-closed-doors decision without asking me so I didn't get a say

    (and just incase the irony is lost on anyone... I'm very glad that decision was just made and implemented without fuss, and I don't care what the name is as long as it doesn't start with '.').

    Introducing /run

    Posted Mar 30, 2011 21:38 UTC (Wed) by cmccabe (guest, #60281) [Link]

    If you're looking at the root directory or changing stuff in it, you are assumed to know what you're doing.

    If you're using a novice-friendly environment like Ubuntu, Android, a set-top box, Meego, or whatever, the root directory will be hidden from you, and you won't have to worry about what /dev/hpet is, or /usr/lib64, or any of that stuff.

    Longer path names just inconvenience the knowledgeable people without providing any corresponding gain for the novices.

    Introducing /run

    Posted Mar 31, 2011 2:42 UTC (Thu) by pyellman (guest, #4997) [Link]

    This is the kind of crazy logic I expected, rather than something sensible. "If your looking in the root directory you're assumed to know what you're doing"? Are you serious? Same for the the "it was /var/run, so now it's just /run" argument. So what? Seems like a good time to tidy that up as well. I think the only reasonable answer I've seen yet is the "because the Unix gurus of old deemed it so". I assume at one time, it might have really mattered (in terms of limitations on path length, etc.), but those days are in the distant past.

    For the record, I have introduced (or tried to introduce) Linux to a number of new users, generally from the Microsoft but some from the Apple world. Without exception, they have found the cryptic naming "conventions" for the root directory to be off-putting. Their displeasure only deepens when they are offered an explanation, and they adopt a genuine scowl when told the blunt truth: because the programmers who built the system prefer it that way.

    I would venture that the cryptic root naming convention is the most immediate, visible, and universal barrier to entry for potential new Linux users. The sad part is, it doesn't have to be so.

    Introducing /run

    Posted Mar 31, 2011 11:24 UTC (Thu) by Seegras (guest, #20463) [Link]

    > I would venture that the cryptic root naming convention is the most
    > immediate, visible, and universal barrier to entry for potential new Linux > users. The sad part is, it doesn't have to be so.

    You're very wrong. Because for a non-english speaker "bin" is just as alien as "binaries".

    And if you don't want to go there, but l10n everything, you'll end up in a _terrible_ mess. See Windows, some fuckwits did that: "Program Files" and "Programme" and "Logiciel".

    Cheers
    Seegras

    Introducing /run

    Posted Mar 31, 2011 13:46 UTC (Thu) by zzxtty (guest, #45175) [Link]

    I'm tired of people trying to take a powerful operating system and turn it into a Windows clone that grandma can use. Linux has a target audience, it is not aimed at the computer-illiterate, renaming /etc/ to /a_folder_that_contains_configuration_information_for_various_computer_programmes_which_you_probably_dont_need_to_worry_about helps nobody. One size does not fit all, the more you try to appeal to the masses the less appealing the operating system will become.

    Introducing /run

    Posted Mar 31, 2011 13:50 UTC (Thu) by Trelane (subscriber, #56877) [Link]

    it's OK. Gentoo and slack and LFS and other such distros are still there.

    Introducing /run

    Posted Mar 31, 2011 16:32 UTC (Thu) by martinfick (subscriber, #4455) [Link]

    If your design you system with newbies as the priority, you will only have newbies on your system. Have you ever heard of Windows guru? If you have, it likely does not mean: "someone who is powerful with windows and can do lots with it", but rather "someone who knows and understands all the dirty hacks and ways around or to avoid them". Does anybody aspire to that?

    I for one am reminded with many reasons any time I touch a windows (rare) PC, why I don't like it. Long untraversable (and weirdly hidden and tangled) paths which seem different on every windows version are one of the reasons. GUIs seem of no help to me to understand the layout either since each GUI twists and pretends the paths start at different roots.

    So, you may believe that newbies understand long names better, but I suspect that what really happens is that nobody understands them. So, if the only way you can make a newbie as smart as an expert is by making the expert dumb, perhaps you have not really gained anything?

    But again, read the previous posts. It is not about old gurus or being harder to type. It is about being able more easily read things, to visualize and remember a whole directory structure in one's head fairly easily. It's about making problems smaller and more easy to comprehend, more local. Your PC is not the WWW, it should not need long global directory names to separate itself from the rest of the PCs on the internet.

    Keep the simple things simple. Yes, "simple", not "dumbed down". Assume (and enable) some level of competence and you will be rewarded with it. Assume idiots (and prevent progress) and you will get...

    Introducing /run

    Posted Mar 31, 2011 22:29 UTC (Thu) by cmccabe (guest, #60281) [Link]

    > This is the kind of crazy logic I expected, rather than something
    > sensible....

    > I would venture that the cryptic root naming convention is the most
    > immediate, visible, and universal barrier to entry for potential new Linux
    > users. The sad part is, it doesn't have to be so.

    Doesn't MacOS have most of the same top-level directories as Linux? And isn't MacOS the operating system that user interface gurus love to go on and on about? Go away, troll.

    Introducing /run

    Posted Apr 1, 2011 0:04 UTC (Fri) by pyellman (guest, #4997) [Link]

    I was going to let it ride, but out-and-out assholes like cmccabe really need to be dealt with.

    >Doesn't MacOS have most of the same top-level directories as Linux?

    No, as it turns out, it really doesn't. http://osxdaily.com/2007/03/30/mac-os-x-directory-structu.... It seems Apple has retained many of the directory names/labels, some apparently for "historical" purposes, but that in a number of key cases they also have other directories with similar functions but more informative labels.

    In any case, I wasn't criticizing the existing names of root-level directories, as those would obviously be painful to change, but merely noting that an opportunity to provide a more informative name for a NEW top-level directory had been passed up. Make sure you know for what reason you're calling someone a troll or else you will provide a clear opportunity for someone to point out that you're an asshole.

    >And isn't MacOS the operating system that user interface gurus love to go on and on about?

    Oh, hell, I don't know; I guess so. I don't pay much attention to the MacOS crowd.

    Introducing /run

    Posted Apr 1, 2011 18:15 UTC (Fri) by cmccabe (guest, #60281) [Link]

    I called you a troll because I genuinely did not see how anyone could hold the point of view you were espousing. Maybe I was a little bit too hasty.

    Let me just rewind a bit. You said that:

    > I would venture that the cryptic root naming convention is the most
    > immediate, visible, and universal barrier to entry for potential new Linux
    > users. The sad part is, it doesn't have to be so.

    Yet MacOS has the same naming convention (except it doesn't have a /lib directory.) Somehow, nobody has found it to be an "immediate, visible and universal barrier to entry" for MacOS.

    Thanks for the explanation

    Posted Mar 30, 2011 22:36 UTC (Wed) by david.a.wheeler (guest, #72896) [Link]

    I expected to be strongly against this proposed "/run", and instead, I find myself persuaded. Lennart Poettering: thanks for posting *why* this is being proposed. *AND* for coordinating with other distro's, since most of us write code to work on many platform.

    Changing old specs is just fine, as long as there's a reason for it. I hope that FHS adds this (and at least something about libexec).

    Thanks for the explanation

    Posted Mar 30, 2011 23:41 UTC (Wed) by roblucid (guest, #48964) [Link]

    Let's just hope the desktop developers understand it, they didn't seem to grok /tmp & /var/tmp in past.

    Thanks for the explanation

    Posted Mar 31, 2011 21:42 UTC (Thu) by jond (subscriber, #37669) [Link]

    Really, all they need to grok is $TMPDIR, and/or possible $XDG_CACHE_HOME.

    Thanks for the explanation

    Posted Mar 31, 2011 11:38 UTC (Thu) by Seegras (guest, #20463) [Link]

    Well, there seems to be a case for /run. But what exactly is the case for libexec?

    As far as I can see libexec serves mostly to annoy sysadmins so they have to search for "updatedb" there... ;) Or am I wrong?

    Thanks for the explanation

    Posted Mar 31, 2011 12:26 UTC (Thu) by rahulsundaram (subscriber, #21946) [Link]

    Thanks for the explanation

    Posted Apr 21, 2011 13:23 UTC (Thu) by Seegras (guest, #20463) [Link]

    "As such in a simplified view libexecdir contents are more like bindir contents only that they don't appear in the user's path."

    That is not a case for libexec. That is a case for NOT having any libexec whatsoever.

    Thanks for the explanation

    Posted Apr 21, 2011 13:40 UTC (Thu) by rahulsundaram (subscriber, #21946) [Link]

    You asked for a rationale and one has been provided. If you disagree, provide a alternative solution instead of naysaying. This is where FHS as a maintained standard would be useful. Unfortunately this isn't the case now.

    Introducing /run (a Filesystem Hierarchy Standard perspective).

    Posted Mar 31, 2011 0:02 UTC (Thu) by rusty (guest, #26) [Link]

    As coeditor for FHS 2.2 and 2.3 (the last one before the LSB included it), I thought it might be worth commenting. That was 10 years ago, so I can't speak for the FHS today.

    The FHS 2.3 states "Distributions should not create new directories in the root hierarchy without extremely careful consideration of the consequences including for application portability." I think this bar has been fairly convincingly met for this case.

    Note also that many of the aims of FHS, such as allowing /usr to be read only or sharing it across machines, are quaint by today's standards, and are not possible in major modern Linux distributions. But changing standards fast makes for very unhappy users, so legacy remains.

    Cheers,
    Rusty.
    What Do We Want? LWN Supporter Subscription!
    When Do We Want it? Um... soon... please?

    Introducing /run (a Filesystem Hierarchy Standard perspective).

    Posted Mar 31, 2011 6:26 UTC (Thu) by rodgerd (guest, #58896) [Link]

    Running ro-/usr and sharing it across systems has a new lease of life in a world of mass-virtualised environments.

    Introducing /run (a Filesystem Hierarchy Standard perspective).

    Posted Mar 31, 2011 8:29 UTC (Thu) by rleigh (guest, #14622) [Link]

    Sharing /usr does not make sense when /usr is just one TLD out of several under the control of the package manager. Package installation and upgrading are going to be "interesting". It's also sharing the wrong thing; modern distributions allow / to be shared as easily as /usr, so you can just share the entire lot. If you so desire, you can use a unionfs/aufs overlay to make the read-only image writable.

    Regards,
    Roger

    Introducing /run

    Posted Mar 31, 2011 1:53 UTC (Thu) by bk (guest, #25617) [Link]

    I hate new top-level directories. We are stomping on decades of Unix convention.

    However, I think /run makes sense. However we should now get rid of /proc. Probably /dev as well, since devices cannot be assumed to be static.

    So we will have /run/proc and /run/dev and we are -1 for net top level directories. Sounds like a win.

    Introducing /run

    Posted Mar 31, 2011 2:18 UTC (Thu) by neilbrown (subscriber, #359) [Link]

    The connection is probably not obvious but your observations lead me to the thought that the next "logical" step is for '/' to be a tmpfs filesystem (the same one that initramfs is loaded into - no need for pivot root).

    /run, /dev, and maybe /tmp are just subdirectories of '/'.

    /bin, /etc, /usr, /var are all distinct mount points... probably --bind mount points. e.g

      mkdir /root
      mount LABEL=rootfs /root
      for dir in bin sbin etc var lib
      do mkdir /$dir ; mount --bind /root/$dir /$dir
      done
    
    This means there is just one tmpfs filesystem with all the important stuff, and it is harder for rogue sysadmins to put extra non-standard things in / :-)

    Introducing /run

    Posted Mar 31, 2011 11:42 UTC (Thu) by Seegras (guest, #20463) [Link]

    > the next "logical" step is for '/' to be a tmpfs filesystem

    That only makes sense for you initrd-guys.

    Introducing /run

    Posted Mar 31, 2011 19:15 UTC (Thu) by lindi (subscriber, #53135) [Link]

    pivot_root has not been used for quite some time. The "run-init" binary from klibc just mounts your hdd over / and chroots to it:

            /* Overmount the root */
            if (mount(".", "/", NULL, MS_MOVE, NULL))
                    return "overmounting root";
    
            /* chroot, chdir */
            if (chroot(".") || chdir("/"))
                    return "chroot";
    
            /* Open /dev/console */
            if ((confd = open(console, O_RDWR)) < 0)
                    return "opening console";
            dup2(confd, 0);
            dup2(confd, 1);
            dup2(confd, 2);
            close(confd);
    
            /* Spawn init */
            execv(init, initargs);
    

    Introducing /run

    Posted Apr 1, 2011 17:37 UTC (Fri) by nix (subscriber, #2304) [Link]

    It doesn't take care to erase everything else in the initramfs beforehand? So it stays eating up memory forever?

    Seems a bit of an omission.

    (busybox's switch_root has never had this problem.)

    Introducing /run

    Posted Jan 20, 2012 20:15 UTC (Fri) by smurf (subscriber, #17840) [Link]

    Just for the record:

    Notice the MS_MOVE up there? This means that the source directory is moved there, thus the old root is (lazily) unmounted.
    Unmounting a tempfs causes the files to get freed.
    So in fact there is no problem.

    Introducing /run

    Posted Jan 26, 2012 18:19 UTC (Thu) by nix (subscriber, #2304) [Link]

    This is not the case. mount("a","b"), no matter the flags, will never unmount "b". It just mounts "a" over the top of it: unmounting "a" will show you "b" still sitting there.

    Inspecting /proc/self/mounts should show you this as well: both mounts are still shown, mounted in the same place.

    Introducing /run

    Posted Mar 31, 2011 7:31 UTC (Thu) by Wummel (subscriber, #7591) [Link]

    This reminds me of djb's /service directory from the daemontools. Nice to see that this idea of daemontools comes back to life after so many years.

    Ah, DJB...

    Posted Apr 3, 2011 15:14 UTC (Sun) by khim (subscriber, #9252) [Link]

    DJB has a lot of great ideas. Sadly they are usually tightly intermixed with bunch of insane ideas so they tend not to gain traction till someone reinvents them years later.

    Next Step...

    Posted Mar 31, 2011 9:27 UTC (Thu) by ldo (guest, #40946) [Link]

    Creating /share as an alternative to /usr/share. Why? So /usr/share/zoneinfo can be moved to /share/zoneinfo. Why? So that /etc/localtime can become a symlink, instead of a copy of a timezone file. Why? So that ls -l /etc/localtime will show you at a glance what your system timezone setting is.

    Next Step...

    Posted Mar 31, 2011 11:06 UTC (Thu) by rleigh (guest, #14622) [Link]

    This will naturally arise from the unification of / and /usr. I plan on having a unified / and /usr (with /usr being a symlink to / for compatibility) as an install-time option for Debian wheezy. Once done, you'll have /games, /include, /local, /share, /src etc. at the top level, but which can still be referred to as /usr/include, /usr/local etc.

    Regards,
    Roger

    Next Step...

    Posted Mar 31, 2011 23:30 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link]

    Please, please, please. Tell me that it's a joke. Please....

    Next Step...

    Posted Apr 1, 2011 17:44 UTC (Fri) by hmh (subscriber, #3838) [Link]

    It is not. But expect quite a lot of resistance in the Debian side. Unlike the addition of /run, which we wanted to do years ago, killing /usr is NOT going to be well received at all.

    Next Step...

    Posted Apr 1, 2011 17:48 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link]

    Absolutely there's going to be resistance. And for a good reason, the / namespace is already too polluted.

    Besides, "/usr on a separate disk" is still fairly common.

    Next Step...

    Posted Apr 2, 2011 16:32 UTC (Sat) by rleigh (guest, #14622) [Link]

    Separate /usr is extremely common, and this isn't going to go away anytime soon. It will also never be possible to make the transition automatic: it could well require repartitioning in order to get a big enough root partition, or LV resizing etc. So having a unified / and /usr will only be possible to do on a fresh install. Initially, it will just be an option, and it won't be the default. But it will be /possible/.

    Having a unified / and /usr isn't a new concept. Debian GNU/Hurd was doing this for years, with a /usr -> / symlink. It won't take much work to get this working on GNU/Linux. The main thing is finding and eliminating duplicate paths which would be overwritten; most of the duplicates are workarounds due to the split in the first place.

    It's very common for people to have a knee-jerk negative reaction to this: after all, it's a radical departure from what we've been used to for decades. However, please do take the time to consider what you have gained from a separate /usr. For the vast majority of cases, nothing is gained other than needless complexity.

    Most of the historical reasons for having the split are long gone. Sharing /usr between machines makes zero sense when you are using a modern package manager. Having a separate /usr for booting no longer matters now we have a capable initramfs which sets up the system sufficiently to allow any filesystem to be mounted: we can just mount / containing /usr directly; previously it was not always possible to do this if you needed to e.g. start up RAID arrays, discover LVM volume groups, bring up networking etc. Previously, you needed to do this using programs on the root filesystem as part of the startup sequence. Today, the initramfs does all of this. Now we have /run [I implemented this for Debian over the last two days in base-files and initscripts; should be available very soon] we are looking much nearer having a read-only / by default. It's common to have a read-only /usr; now you'll be able to have a read-only / *including* /usr.

    Regarding top-level namespace pollution, most of the directories are duplicates, and those that are not still logically fit.

    Regards,
    Roger

    Next Step...

    Posted Apr 2, 2011 16:41 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link]

    I gain at least a measure of order from /usr.

    First, why do I need "/include"??? A language-specific directory on the top level? "/games" is equally stupid.

    Oh, and how about /amd64-mingw32msvc, /arm-linux-gnueabi or /i586-mingw32msvc? Won't it be lovely to have them on the top level?

    What we really need is consolidation of everything under ONE directory. I'd better move /bin, /sbin, /lib TO /usr if I had my way. Unfortunately, it's too deeply ingrained by now in all sorts of applications.

    Think about it for a second. Imagine that you'd have a Linux with /etc, /home, /var, /usr in the top directory. Maybe also /system for sysfs, procfs and runtime directories. Won't it be easier to manage and use?

    Next Step...

    Posted Apr 2, 2011 17:51 UTC (Sat) by rleigh (guest, #14622) [Link]

    The individual extra paths are purely cosmetic. That's really missing the point of why a separate /usr is bad and/or unnecessary. And by separate, I mean separately mountable.

    There's a significant cost to having a separate /usr. That cost is having some parts of the system unavailable before it is mounted, which makes the system have to go through complex contortions to actually start up.

    Consider the NSS modules under /lib/libnss*.so used by the eglibc resolver. They may have dependencies on other libraries. Some of the LDAP modules have depend on libraries in /usr e.g. cryto libraries. If that module is needed to bring up the system, all those libraries must be moved to /lib, and any other data they need from /usr must be brought into the root.

    Also consider eglibc itself; the locale data and other parts are found under /usr. If you use any of these facilities before /usr is mounted, it can break in "interesting" ways.

    Those are just two examples. There's plenty more. The point is that it's complex, fragile, and makes some things incredibly hairy, and other things not possible at all.

    These issues go away when you don't have a separate /usr. If you no longer have a separate / and /usr (i.e. mounting the roofs gets you both), then you have to question why you have /usr at all. Seriously, why? What advantages does it give you? It the cost/benefit worth it? I've spent some time thinking about the issue--you can see a link to my thoughts on the matter elsewhere on this page. Unifying / and /usr is a logical consequence of this.

    An important concept to grasp is that on a modern package-managed distribution, / and /usr are not separable, and in fact have never been separable. They exist as a managed whole, and it is not possible to use or upgrade/maintain one without the other.

    Regards, Roger

    Next Step...

    Posted Apr 2, 2011 18:12 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link]

    Then one can unify /var and /. What if one needs Postfix running in order to use SMTP to get a one-time password for the system to boot? Or maybe /var/spool is necessary for CUPS to print out boot logs on a remote printer?

    Your argument is incredibly weak. If you need LDAP for your system to mount /usr then you definitely doing something wrong and you just should make sure that /usr is available before LDAP is needed. And uniting / and /usr won't give you ANYTHING, since in this case you won't even have the final / if LDAP is not available.

    Besides, namespace pollution is a reason in itself to avoid throwing some extra stuff to /.

    Next Step...

    Posted Apr 4, 2011 2:38 UTC (Mon) by hmh (subscriber, #3838) [Link]

    1. /usr inside /: we have been through that recently enough in debian-devel. There were many objections, and it was rejected for the time being.

    It is very unlikely to fly until RO / becomes a reality. And unlike /run,
    since it has been recently rejected, any attempts to get this deployed without getting most of the issues addressed are likely to backfire very nastly.

    And you cannot have "no /usr" if you don't solve this one first, as all reasons for rejecting it are also valid for "no /usr".

    2. no /usr: an EXTREMELY HARD sell. It causes a major mess on / and to my knowledge it will give us no strong technical advantages at all. It needs to wait for (1) above to be resolved, anyway.

    Next Step...

    Posted Apr 13, 2011 11:53 UTC (Wed) by robbe (guest, #16131) [Link]

    > Regarding top-level namespace pollution, most of the directories are
    > duplicates, and those that are not still logically fit.

    Maybe get rid of cruft like /usr/{games,src} first? They have no reason to live.

    Next Step...

    Posted Apr 2, 2011 14:51 UTC (Sat) by pr1268 (subscriber, #24648) [Link]

    While we're at it, why not introduce "/Program Files"?

    /Ducks for cover
    /Realizes April Fools' was one day ago

    Next Step...

    Posted Apr 2, 2011 22:58 UTC (Sat) by mezcalero (subscriber, #45103) [Link]

    Go the other way. Make /bin, /sbin, /lib and /lib64 symlinks to their counterparts in /usr. If you do, then suddenly /usr gets its original meaning back as "Unix System Resources". Because that's what it is going to be then: in /usr you find "The OS". And in / you will then only have a few top-level directories whose meaning is clearly bound to lifecycle properties, nothing else anymore.

    Think a bit about this, let it sink in. It's much nicer to symlink the root /bin, /sbin, /lib directories into /usr, then the other way round.

    Next Step...

    Posted Apr 3, 2011 21:51 UTC (Sun) by Cyberax (✭ supporter ✭, #52523) [Link]

    This is a bit nicer. I really hate all those extra folders in the root directory.

    However, here's the next question. If we get rid of separately-mounted /usr then we should as hell have something to replace it.

    The current initramfs-based infrastructure just doesn't cut it (even in Dracut). It's way too complex to manage. What if I want to have a LDAP client in initramfs?

    Hm. Why not treat initramfs as a small separate installation?.. It can even be managed using chroot'ed package managers. Hmmm...

    Next Step...

    Posted May 4, 2011 22:33 UTC (Wed) by nix (subscriber, #2304) [Link]

    That seemed cracked at first sight, but the more I think about it the more sense it makes. (I think SysV did something like it, too, but I don't have a SysV system nearby to check.)

    It requires only one change to early boot: the initramfs needs to find and mount /usr as well as /. Since it's already finding /, this is unlikely to be remotely problematic: it can figure out where to find it by consulting the real /etc/fstab on the / it just mounted, as well.

    I think I'll rejig my system this way and see what breaks.

    Introducing /run

    Posted Mar 31, 2011 13:53 UTC (Thu) by jcm (subscriber, #18262) [Link]

    This isn't a bad idea. But, some questions:

    * Who is "we"? Is "we" really "the systemd developers", because that's a small set.

    * Was there any attempt to raise this as LFS prior to making the change?

    I know the latter has been done retrospectively at least.

    Jon.

    Introducing /run

    Posted Mar 31, 2011 20:36 UTC (Thu) by rahulsundaram (subscriber, #21946) [Link]

    "we" would be developers of systemd, mdadm, udev, util-linux, dracut and others including developers from other distributions such as openSUSE and Debian. Ubuntu is in favor of the change as well.

    You repeatedly keep saying LFS but you mean FHS and FHS explicitly allows distributions to add top level directories as required and a bug report has been filed against FHS asking for a change (although it hasn't been updated since 2004) and the co-author of the standard has been positive about this change right here in the same thread. In other words, no reason to complain.

    Introducing /run

    Posted Mar 31, 2011 20:41 UTC (Thu) by jcm (subscriber, #18262) [Link]

    You're right, I do mean FHS.

    Jon.


    Copyright © 2011, Eklektix, Inc.
    Comments and public postings are copyrighted by their creators.
    Linux is a registered trademark of Linus Torvalds