Proposes alternative to fix this, by changing to a new system , which will solve this problem, once it's always there.
> There's already the lsb_release tool for this, why don't you just use that? Well, it's a very strange interface: a shell script you have to invoke (and hence spawn asynchronously from your C code), and it's not written to be extensible. It's an optional package in many distributions, and nothing we'd be happy to invoke as part of early boot in order to show a welcome message. (In times with sub-second userspace boot times we really don't want to invoke a huge shell script for a triviality like showing the welcome message). The lsb_release tool to us appears to be an attempt of abstracting distribution checks, where standardization of distribution checks is needed. It's simply a badly designed interface. In our opinion, it has its use as an interface to determine the LSB version itself, but not for checking the distribution or version.
And I guess distributions are far more reluctant to install a shell script than adding a file to /etc
If only Linux packaging system had some kind of dependency system. That way systemd and other LSB needing packages could require lsb. You could even have some kind of automated packaging tool, or perhaps modify yellowdog updater, to fetch those dependencies automatically.
It would be 'hard' to make lsb_release do what they want (either the maintainers reject their pull requests, or perhaps outright reject their ideas) and its 'easy' to create a new way to do it.
Hence every copy of Linux has some percentage of the 'boring' stuff which works the same everywhere, and the 'interesting' stuff works differently between major distros,
Things are 'boring' if nobody cares about them.
Things are 'interesting' if they are user facing, and especially self contained enough that the entire feature can be shipped in one moderate sized patch.
Aye, and if you don't implement it you are "working towards the further balkanization of the Linux landscape".
Is this arrogance? Dictatorship? Am I being too sensitive? Whatever it is, it does not strike me as an effective way to get people on board.
Tell us why it is better, not that we are wrong if we don't do it.
However I agree with you that lsb-release is not much used, and in some distros is only present when some huge X-dependent LSB package is installed.
But hey, we could fix LSB! Instead of, you know, making up something new that will be as little used as lsb-release.
cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.10
DISTRIB_CODENAME=oneiric
DISTRIB_DESCRIPTION="Ubuntu 11.10"[2] To our knowledge at least OpenSUSE, Fedora, ArchLinux, Angstrom, Frugalware have adopted this.
So "OpenSUSE, Fedora, ArchLinux, Angstrom, Frugalware" is "the majority of the big distributions" now?
It doesn't have /etc/lsb-release either.
Instead the lsb-release program apparently simply outputs the necessary values without using a configuration file.
I'm guessing the debian version of systemd just patches it to handle debian, and not make it autoconfigure each time from a configuration file.
The author of this blog post, Lennart Poettering, apparently works for Red Hat. Even Hat Enterprise Linux is missing from the list. As is CentOS.
There also seems to be a bug report for it on Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=659891
One thing I feel people might be missing is that /etc/os-release could be applicable to Mac OS and the BSDs, making it widely applicable.
~$ /etc/os-release
bash: /etc/os-release: No such file or directoryOn the other hand, when was this discussed? Are all the Linux distros and BSD on board? OS X? Windows? (I'm serious)
/etc/os-release has all the problems of /etc/lsb-release, but even fewer people will use it (if you count distro numbers rather than users, hardly anyone is using lsb-release).
This file could have been a lot more useful if it had been discussed with people who might consume it. As it is, we'll be parsing this as a fallback, but continue using distro-specific release files.
[1] https://github.com/libguestfs/libguestfs/blob/84a4160fd30c46...
One is that I believe it shouldn't be in /etc which is generally used for configuration data, not for static distribution info. I'd put it somewhere in /usr/lib or /usr/share.
Second, I think that the linked documentation (http://www.freedesktop.org/software/systemd/man/os-release.h...) is incomplete in that it doesn't specify quoting behavior: The file doesn't say anything about when or if at all values need to be quoted but the has quotes on some string values (but not all) in the example.
Are the quotes part of the value and thus should be displayed? Or are quotes needed for values with spaces in them?
Yes. I'm nit-picking, but IF you have to start off a new standard, please be sufficiently precise in order to reduce the need for somebody else having to do the same a few years down the road.
Other possible questions: Do custom keys need to be uppercase? Can they contain spaces themselves? ANSI_COLOR is a nice idea, can we also have a background color? Are spaces allowed in front and after the = sign? Are spaces in front and after the = sign part of the key or value? Or are they to be ignored?
Maybe use a standard format like YAML or JSON or (god forbid) XML which already has things like this covered.
Yes. This is all really small stuff, but in the end it's this unspecified small stuff that causes everybody to implement their solution differently which in turn makes writing a parser needlessly hard (or even impossible if there are conflicting interpretations)
Unix shells have very well defined specifications.
Why didn't you call this file /etc/bikeshed instead?
Nothing like good self-referential, recursive, meta humor. :)
Scripts that care where things are should do their own investigation and determine the locations of files and how daemons are configured themselves. In other words, use the primary sources.
Though I'm not even sure if thats really possible.
I've never understood why most major Linux distribution creators chose to come up with their own /etc/*-release files. Why make it distribution-specific at all?
In all seriousness, what's wrong with the /etc/release file (Solaris) that predates Linux? The name is obvious, terse, and easy to remember.