[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Is there a way to positively, uniquely identify which Debian release a program is running on?

Gabor Gombas <gombasg@sztaki.hu> writes:
> On Wed, May 30, 2007 at 04:46:30PM -0400, Kris Deugau wrote:

>> However, there doesn't seem to be any single, consistent,
>> doesn't-change-for-the-life-of-the-release, programmatically possible
>> (never mind *easy* just yet...) method to find out if I'm on Debian
>> sarge, etch, lenny, or some third-party Debian-derived distribution.

> Your approach is wrong. Many machines have packages installed from
> multiple distributions simultaneously (sarge+etch, sarge+backports,
> etch+backports, etch+lenny, lenny+sid, sid+experimental are probably the
> most common combinations nowadays). Backported packages may even be
> compiled locally so they may not have any distribution associated with
> them at all.

Hm, it's often not a good idea to tell people that they're doing something
wrong just because it doesn't work globally with everyone's systems.  It
can come across poorly, and often what they're asking for makes perfect
sense in their environment.  If we as a project can't provide them with
the right tool because it doesn't make sense in our context, that's a good
response, but just telling them they're taking the wrong approach isn't
particularly useful.

For example, at Stanford, while some of our staff workstations do have
those package mixes, our servers are either sarge or etch.  Asking whether
a given server is sarge or etch is a quite reasonable and rational
question with a well-defined response.  And it is very useful for us to be
able to select, inside Puppet, whether a given system is sarge or etch (to
take an obvious example, we want to maintain sources.list via Puppet, but
we don't want Puppet to convert a sarge system to an etch system or vice
versa).  Doing that via automatic discovery on the system is the right
approach since maintaining a list of what systems are which (ever-changing
given that we're doing upgrades now) would be tedious and often inaccurate
for our hundreds of servers.

lsb-release via facter works quite well for this purpose for us.  That it
doesn't work with sid/lenny systems isn't a problem for us currently, and
will never be a problem provided that it's fixed before lenny becomes
stable.  :)

Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>

Reply to: