Ubuntu cfengine classes impersonate Debian Etch

Bug #111385 reported by Mike Renfro
6
Affects Status Importance Assigned to Milestone
cfengine2 (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Binary package hint: cfengine2

cfengine2, version 2.1.20-1 (Ubuntu 7.04 release)

root@ch204b:~# cfagent -n -v -q | grep 'Defined Classes'
Defined Classes = ( ... compiled_on_linux_gnu debian debian_4 debian_4_0 ... )

Ubuntu may be able to classify itself as debian on some level, but using debian_4 and debian_4_0 just aren't correct. I'm in the early stages of moving my systems into cfengine, and an etch sources.list ended up on my Ubuntu system during an upgrade from 6.10 to 7.04. So now all my cfengine rules are of the form:

copy:
  debian.!ubuntu::
  ...

after I defined an ubuntu class via:

classes:
  ubuntu = ( '/bin/grep -q DISTRIB_ID=Ubuntu /etc/lsb-release' )

Revision history for this message
Reinhard Tartler (siretart) wrote :

Looking in src/misc.c, this is totally intended by upstream. They check if the file /etc/debian_version does exist, and setup classes according to that.

to correct fix would be to discuss this issue with upstream, and ask them to do proper dection of ubuntu systems. as interim solution, we can patch src/misc.c according to our needs

Changed in cfengine2:
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Revision history for this message
Reinhard Tartler (siretart) wrote :

oh, I'm sorry, I should have checked for a duplicate bug earlier

Revision history for this message
Mike Renfro (renfro) wrote : Re: [Bug 111385] Re: Ubuntu cfengine classes impersonate Debian Etch

On 5/1/2007 10:30 AM, Reinhard Tartler wrote:
> *** This bug is a duplicate of bug 50789 ***
> https://bugs.launchpad.net/bugs/50789
>
> oh, I'm sorry, I should have checked for a duplicate bug earlier

This is slightly related, but not actually a duplicate, and I don't
think 50789 got fixed as of 7.04 release. Another run without any
cfagent.conf or update.conf files (some classes edited out):

root@ch204b:/etc/cfengine# ls
autoapt.cfg autostow.cfg cfagent.conf.old
autoapt.pl autostow.pl update.conf.old
root@ch204b:/etc/cfengine# cfagent -n -v -q | grep 'Defined Classes'
Defined Classes = ( ... 32_bit Day1 Hr13 Hr13_Q2 May Min20_25 Min22 Q2
Tuesday Yr2007 addr_ any ... compiled_on_linux_gnu debian debian_4
debian_4_0 ... )
cfengine:ch204b::0: Warning: actionsequence is empty
cfengine:ch204b::0: Warning: perhaps cfagent.conf/update.conf have not
yet been set up?
root@ch204b:/etc/cfengine# cfagent -n -v -q | grep 'Defined Classes' |
grep -i ubuntu
cfengine:ch204b::0: Warning: actionsequence is empty
cfengine:ch204b::0: Warning: perhaps cfagent.conf/update.conf have not
yet been set up?
root@ch204b:/etc/cfengine#

So two issues: first, 50789 appears to be still active, since I don't
get any Ubuntu-related classes defined. Second (the cause of my original
problem), that Ubuntu classifies itself as Debian 4.0, which might cause
some users' configurations to retrieve etch versions of sources.list,
passwd, etc.

--
Mike Renfro / R&D Engineer, Center for Manufacturing Research,
931 372-3601 / Tennessee Technological University -- <email address hidden>

Revision history for this message
Reinhard Tartler (siretart) wrote :

Mike Renfro <email address hidden> writes:

> This is slightly related, but not actually a duplicate, and I don't
> think 50789 got fixed as of 7.04 release. Another run without any
> cfagent.conf or update.conf files (some classes edited out):

Well, I agree that we can debate if this is the same bug or
not. However, the fix is to fixup src/misc.c to report ubuntu specific
classes instead of the debian ones. Therefore I marked the bug as
duplicate.

If you still disagree, feel free to unmark bug 111385 as duplicate

--
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4

Revision history for this message
gil (gilbert-laycock) wrote :

I incline to keeping it a duplicate.

The root of the problem is that cfengine quite reasonably uses /etc/debian_version as an indication that a system is "debian" and a particular version. There are probably good reasons unrelated to cfengine for ubuntu systems to retain /etc/debian_version, but perhaps it should include some indication of the ubuntu version in there instead of the debian version. In the meantime the debian_* classes are next to useless for cfengine setups with both debian and ubuntu systems. As far as I can tell there is no general way that ubuntu installations identify which release they are - unless you install lsb-release, or use crude hacks that try to parse sources.list.

However, installing lsb-release includes all the information needed to distinguish debian/ubuntu systems, and the patch mentioned in bug 50789 would use this to define new cfengine classes. The debian_* classes would still be useless though.

The patch in bug 50789 is not in fiesty, or even in debian unstable yet (which has v2.1.22); but it is upstream in v2.2.0.

Until 2.2 arrives, perhaps the ubuntu package could include a cfengine module file that looks for lsb-release and uses it to define the same classes as v2.2 will. This is presumably essentially what most sysadmins in this situation are already doing, and at least it would standardise things a bit and reduce problems when people upgrade to new releases.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.