Bug#369265: fai-nfsroot: fai install dies with "nfs: RPC call returned error 101"

2006-06-08 Thread Thomas Pöhnitzsch
Hi,

On Fri, Jun 02, 2006 at 12:15:22PM +0200, Henning Sprang wrote:

> BTW: I don't understand the name of this bug. Why is a bug which
> creates problems in nfsroot building filed with the topic that fai
> gives an error at install time: "nfs: RPC call returned error 101"

well the name of the bug actually describes exactly the problem I had. I
never said that building the nfsroot failed, as it did not for me. 

When I was looking for a name, I tried to make it easier for other
"fai-users" to easily find a bug that covers the problem they just
stumbled across. I could of course have named it "divert fails with new
FHS compliant dhcp3" but then who would profit? Well maybe Thomas L.
who maybe, would not have to read the body of the bug in order to fix
it.

People tend to look for bugs named to what they "see", and not what
the solution of their problem may be.

> I am not sure because it's a while since I had that, is it possible
> that make-fai-nfsroot doesn't "realize" what's happening, and still
> finishes successfully, and the problems leading to an error only at
> install time?

make-fai-nfsroot actually finished successfully, and the problem indeed
occurred at install time. And guess what the message was that I saw? ;-)

> Then we should also fix nfsroot to better trap errors, if possible.
> It's wrong that make-fai-nfsroot ends with success but a broken
> nfsroot. But maybe the rror cannot be found out easily.

That's exactly the point, this was one of the bugs you cannot detect.

Cheers,
Thomas (another one)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#369265: missing patch

2006-05-28 Thread Thomas Pöhnitzsch
Sorry, forgot to attach the patch.
Index: debian/fai-nfsroot.dirs
===
--- debian/fai-nfsroot.dirs (revision 3484)
+++ debian/fai-nfsroot.dirs (working copy)
@@ -2,3 +2,4 @@
 etc/dhcp3
 etc/apt/apt.conf.d
 usr/lib/fai
+sbin
Index: debian/fai-nfsroot.install
===
--- debian/fai-nfsroot.install  (revision 3484)
+++ debian/fai-nfsroot.install  (working copy)
@@ -8,7 +8,7 @@
 usr/lib/fai/mount2dir
 usr/lib/fai/task_sysinfo
 usr/lib/fai/mkrw
-etc/dhcp3/dhclient-script
+sbin/dhclient-script
 etc/dhcp3/dhclient.conf
 etc/apt/apt.conf.d/90fai
 etc/modutils/fai_modules_off
Index: debian/fai-nfsroot.preinst
===
--- debian/fai-nfsroot.preinst  (revision 3484)
+++ debian/fai-nfsroot.preinst  (working copy)
@@ -5,7 +5,7 @@
 exit 1
 fi
 
-dpkg-divert --package fai-nfsroot --add --rename /etc/dhcp3/dhclient-script
+dpkg-divert --package fai-nfsroot --add --rename /sbin/dhclient-script
 dpkg-divert --package fai-nfsroot --add --rename /etc/dhcp3/dhclient.conf
 dpkg-divert --package fai-nfsroot --add --rename /etc/init.d/rcS
 
Index: debian/fai-nfsroot.postrm
===
--- debian/fai-nfsroot.postrm   (revision 3484)
+++ debian/fai-nfsroot.postrm   (working copy)
@@ -1,7 +1,7 @@
 #!/bin/sh -e
 
 if [ remove = "$1" ]; then
-dpkg-divert --package fai-nfsroot --remove --rename 
/etc/dhcp3/dhclient-script
+dpkg-divert --package fai-nfsroot --remove --rename /sbin/dhclient-script
 dpkg-divert --package fai-nfsroot --remove --rename 
/etc/dhcp3/dhclient.conf
 dpkg-divert --package fai-nfsroot --remove --rename /etc/init.d/rcS
 fi
Index: Makefile
===
--- Makefile(revision 3484)
+++ Makefile(working copy)
@@ -30,7 +30,7 @@
cd bin ; install $(USRSBIN_SCRIPTS) $(DESTDIR)/usr/sbin
cd bin ; install $(USRBIN_SCRIPTS) $(DESTDIR)/usr/bin
install bin/fai-start-stop-daemon $(DESTDIR)/sbin
-   install bin/dhclient-script  $(DESTDIR)/etc/dhcp3
+   install bin/dhclient-script  $(DESTDIR)/sbin
install -m644 conf/dhclient.conf $(DESTDIR)/etc/dhcp3
install -m644 conf/apt.conf $(DESTDIR)/etc/apt/apt.conf.d/90fai
install -m644 conf/fai.conf conf/sources.list conf/menu.lst 
$(DESTDIR)/etc/fai/


Bug#397784: xen-tools: xen-create-image fetches libc6-xen from ftp.debian.org

2006-11-09 Thread Thomas Pöhnitzsch
Package: xen-tools
Version: 2.8-1
Severity: normal

I set up xen-tools.conf with:
debootstrap = 1
dist = sid
mirror = ftp:///debian

The mirror defined in /etc/xen-tools/xen-tools.conf is ignored when
xen-create-image installs libc6-xen.

Thus the installation of libc6-xen should probably be moved to the hook
20-setup-apt, just after the "apt-get update" call.

Thanks,
Thomas

-- 
| Thomas Pöhnitzsch, Dipl.-Inf.   |  foobar GmbH  |
| System Management/Software Development  |  Bernsdorfer Str. 210-212 |
| Tel.: +49 371 5347 - 160Fax: - 158  |  09126 Chemnitz/Germany   |
| E-Mail:  [EMAIL PROTECTED] |  http://www.foobar-cpa.de |


signature.asc
Description: Digital signature


Bug#389905: fai-chboot list wrong information

2006-11-01 Thread Thomas Pöhnitzsch
On Sun, Oct 29, 2006 at 03:52:10PM +0100, Thomas Lange wrote:

>> +while ( length $n ) { 
>> +$host = sprintf( "%s%d" ,$host?"$host.":$host,
>> +(hex substr $n,0,1,"" ) * 16 + (hex substr 
>> $n,0,1,"")); 
>> +}

> Das verstehe ich nicht. Warum eine while schleife ueber $n? Oder soll
> das nur wie ein if $n > 0 funktionieren? IMO macht die schleife aber
> bei jedem Durschlauf das gleich wenn $n > 1 ist.

Solange in $n noch etwas drin ist, verarbeite bis zu 2 Zeichen vom
Anfang von $n. Das ist doch der klassische Trivialfall einer
while-Schleife, und es funktioniert sogar. Ich verstehe daher nicht, was
Dir daran nicht gefällt.

> 
> 
> > -  $srcfile = "$pxedir/$srchost";
> > +  $srcfile = "$pxedir/$srchost.tmpl";
> Verstehe ich auch nicht.

Dann schaue es Dir doch mal im größeren Kontext an:
 } elsif (-e "$pxedir/$srchost.tmpl" ) {
-  $srcfile = "$pxedir/$srchost";
+  $srcfile = "$pxedir/$srchost.tmpl";
 } else {

Es wird erst auf die Existenz des template geprüft und dann eine andere
(evtl. nicht existierende) Datei eingelesen. Ich glaube hier müßten wir
mal diskutieren was der gesamte Block an sich machen soll, aber meines
Erachtens tut er nur mit dem Patch genau das was man/ich (laut manpage)
von ihm erwarten sollte.

> Die man page ist schon gepatched. Leider ist dein patch sehr gross das
> macht es schwer alles einzubauen. Und mein urspruenglicher bug ist
> damit noch nicht gefixt, aber ich habe dafuer jetzt einen patch.

Soso, na das wundert mich jetzt aber, denn bei mir hat er den Bug
behoben. Nur mal so wild aus dem Patch zitiert:
+if (/\.disable$/) {
+if (-f (split /\./)[0]) {
+warn "Skipping $_ as disabled host because also enabled.\n" if 
$verbose; 
+} else {

und dann noch:
+  if (-f "$pxedir/$hex.disable") {
+  unlink "$pxedir/$hex.disable";
+  print "removed old $pxedir/$hex.disable\n";
+  }

Es mag sein, daß Dir das nicht gefällt, aber behoben ist es definitiv,
wie Du auch aus meinen Beispielen erkennen solltest.

Soll ich den Patch nochmal zerlegen? Warum sich das schwer einbauen läßt
verstehe ich leider nicht, da ich den direkt gegen den aktuellen
SVN-Head gebaut hatte, so daß ein einfaches "patch" ausreichen sollte.

Grüße,
thpo

-- 
| Thomas Pöhnitzsch, Dipl.-Inf.   |  foobar GmbH  |
| System Management/Software Development  |  Bernsdorfer Str. 210-212 |
| Tel.: +49 371 5347 - 160Fax: - 158  |  09126 Chemnitz/Germany   |
| E-Mail:  [EMAIL PROTECTED] |  http://www.foobar-cpa.de |



Bug#389905: fai-chboot list wrong information

2006-10-25 Thread Thomas Pöhnitzsch
shd,reboot
[DEFAULT] default.disable vmlinuz-install ip=dhcp FAI_ACTION=sysinfo 
root=/dev/nfs nfsroot=/srv/fai/nfsroot,v3,tcp,rsize=32768,wsize=32768  
FAI_FLAGS=verbose,sshd,createvt

# fai-sources/bin/fai-chboot -Ltv 
Skipping C0A80A01.disable as disabled host because also enabled.
[Template] foo.tmpl vmlinuz-install ip=dhcp devfs=nomount FAI_ACTION=sysinfo 
root=/dev/nfs nfsroot=/srv/fai/nfsroot,v3,proto=tcp  
FAI_FLAGS=verbose,sshd,createvt

# fai-sources/bin/fai-chboot -Lo
[Other] foobar vmlinuz-install ip=dhcp devfs=nomount FAI_ACTION=sysinfo 
root=/dev/nfs nfsroot=/srv/fai/nfsroot,v3,proto=tcp 
FAI_FLAGS=verbose,sshd,createvt

# fai-sources/bin/fai-chboot -p foo
No rootfs specified.

Regards,
thpo

-- 
| Thomas Pöhnitzsch, Dipl.-Inf.   |  foobar GmbH  |
| System Management/Software Development  |  Bernsdorfer Str. 210-212 |
| Tel.: +49 371 5221 - 160Fax: - 158  |  09126 Chemnitz/Germany   |
| E-Mail:  [EMAIL PROTECTED] |  http://www.foobar-cpa.de |
Index: bin/fai-chboot
===
--- bin/fai-chboot  (revision 4112)
+++ bin/fai-chboot  (working copy)
@@ -79,63 +79,76 @@
   opendir(DIR, $pxedir) || die "can't opendir $pxedir: $!";
   foreach (readdir(DIR)) {
 next if /^\./;
-if (/^default/){ push @default,  $_ ; next};
-if (/^[0-9A-F]+$/) { push @enabled,  $_ ; next};
-if (/\.disable$/)  { push @disabled, $_ ; next};
-if (/\.tmpl$/) { push @templates, $_ ; next};
+if (/^(default|[0-9A-F]+)$/) { push @enabled,   $_ ; next};
+if (/\.tmpl$/)   { push @templates, $_ ; next};
+if (/\.disable$/) {
+if (-f (split /\./)[0]) {
+warn "Skipping $_ as disabled host because also enabled.\n" if 
$verbose; 
+} else {
+push @disabled,  $_; 
+}
+next;
+};
 push @other, $_;
   }
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 sub lsdir {
 
-# -lr list only disabled hosts
+# -ld list only disabled hosts
 # -le list only enabled hosts
 # -lt list only templates
 # -lo list only "other", i.e that does not match templates or hosts 
 # -lg list by goups (enabled, disabled, templates, others)
-# -l[retog]  list matching pattern
+# -l[detog]  list matching pattern
 
-  my (@n,$host,$ip,$iaddr,$hex,$type);
+  my ($n,$host,$iaddr,$hex,$type);
 
   @patterns = @_; # a global variable
 
   readpxedir();
 
   # create list which entries we want to list
-  @allfiles = (@default,@enabled,@disabled,@templates,@other);
+  @allfiles = (@enabled,@disabled,@templates,@other);
   $opt_d and @allfiles = @disabled;
   $opt_e and @allfiles = @enabled;
   $opt_t and @allfiles = @templates;
   $opt_o and @allfiles = @other;
-  $opt_g and @allfiles = (@default,@enabled,@disabled,@templates,@other);
+  $opt_g and @allfiles = (@enabled,@disabled,@templates,@other);
 
   # map all entries (in HEX) to hostname or IP
   foreach $hex (@allfiles) {
-undef $type;
-# hex to ip address
-@n = $hex =~ m/[0-9A-F][0-9A-F]/g;
-$ip = join ('.', map {$_ = hex $_} @n);
+undef $host,$type;
 
-if ($hex =~ /^default$/) {
+if ($hex =~ /^default(.disable)?$/) {
   $host = $hex;
   $type = '[DEFAULT]';
 } elsif ($hex =~ /\.tmpl$/) {
   $host = "$hex";
   $type = '[Template]';
-} elsif ($#n > 0 && $#n < 3) {
-  # Don't fail if not a complete IP
-  $host = "Subnet: $ip";
-} else {
-  # ip to hostname
-  $iaddr = inet_aton($ip);
-  if ($h = gethostbyaddr($iaddr, AF_INET)) {
-   $host = $h->name;
-   $host =~ s/^([^.]+).*/$1/; # strip domain from FQDN so we have short 
hostnames
-  } else {
+} elsif ($hex =~ /[0-9A-F]+/) {
+my $hexstrip = (split /\./,$hex)[0]; # remove .disable if necessary
+$n = $hexstrip;
+# hex to ip/subnet address
+while ( length $n ) { 
+$host = sprintf( "%s%d" ,$host?"$host.":$host,
+(hex substr $n,0,1,"" ) * 16 + (hex substr 
$n,0,1,"")); 
+}
+if ( $host and ( length($hexstrip) < 8) ) {
+$host = "Subnet: $host/". length($hexstrip)*4 
+} else {
+# ip to hostname
+$iaddr = inet_aton($host);
+if ($h = gethostbyaddr($iaddr, AF_INET)) {
+$host = $h->name;
+$host =~ s/^([^.]+).*/$1/; # strip domain from FQDN so we have 
short hostnames
+}
+}
+}
+
+if ( !$host ) {
 $host = $hex;
 $type = '[Other]';
-  }
 }
 $hexname{$host} = $hex;
 $hname{$hex}= $host;
@@ -143,7 +156,6 @@
   }
 
   if ($opt_g) { # print in group, sorted inside each group
-prtsorted(@default);
 prtsorted(@enabled);
 prtsorted(@disabled);
 prtsorted