Your message dated Tue, 28 Oct 2008 10:27:47 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#503729: fixed in fai 3.2.14
has caused the Debian Bug report #503729,
regarding [setup-storage] Spurious device not found
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)


-- 
503729: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=503729
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: fai-client
Version: 3.2.13
Severity: important
Tags: patch

While executing commands that refer to device names, occasionally a
device-not-found error is encountered, even though the device is known to exist,
which is manually confirmed afterwards. Furthermore, a second attempt of
performing the same sequence of actions usually succeeds.

This problem is caused by udev refreshing its internal state, and setup-storage
not calling udevsettle in all situations where this would be required.

The attached patch fixes this issue by proactively calling udevsettle before
executing any of the commands.

Best,
Michael

2008-10-16  Michael Tautschnig  <[EMAIL PROTECTED]>

        * bin/setup-storage, lib/setup-storage/Commands.pm, 
lib/setup-storage/Exec.pm:
                Call udevsettle before doing any of the commands to avoid all 
the possible
                pitfalls, simplyfies the code quite a bit.
Index: trunk/bin/setup-storage
===================================================================
--- trunk.orig/bin/setup-storage
+++ trunk/bin/setup-storage     
@@ -173,7 +173,7 @@
 }
 
 # run the commands (if $FAI::no_dry_run is set)
-&FAI::execute_command($FAI::commands{$_}{cmd}) foreach (&numsort(keys 
%FAI::commands));
+&FAI::execute_with_udevsettle($FAI::commands{$_}{cmd}) foreach (&numsort(keys 
%FAI::commands));
 
 # generate the proposed fstab contents
 # wait for udev to set up all devices
Index: trunk/lib/setup-storage/Commands.pm
===================================================================
--- trunk.orig/lib/setup-storage/Commands.pm
+++ trunk/lib/setup-storage/Commands.pm 
@@ -218,26 +218,15 @@
           $pre_req .= ",exist_$d";
         }
       }
-      my $pre_req_no_comma = $pre_req;
-      $pre_req_no_comma =~ s/^,//;
-      # wait for udev to set up all devices
-      &FAI::push_command( "udevsettle --timeout=10", $pre_req_no_comma,
-        "settle_for_mdadm_create$id" );
 
       # create the command
-      if (0 == $id) {
-        $pre_req = "settle_for_mdadm_create$id$pre_req";
-      } else {
-        $pre_req = "settle_for_mdadm_create$id,exist_/dev/md" . ( $id - 1 ) . 
$pre_req;
-      }
+      $pre_req = "exist_/dev/md" . ( $id - 1 ) . $pre_req if (0 != $id);
+      $pre_req =~ s/^,//;
       &FAI::push_command(
         "yes | mdadm --create /dev/md$id --level=$level --force --run 
--raid-devices="
           . scalar(@eff_devs) . " --spare-devices=" . scalar(@spares) . " "
           . join(" ", @eff_devs) . " " . join(" ", @spares),
-        "$pre_req", "run_udev_/dev/md$id" );
-
-      &FAI::push_command( "udevsettle --timeout=10", "run_udev_/dev/md$id",
-        "exist_/dev/md$id" );
+        "$pre_req", "exist_/dev/md$id" );
 
       # create the filesystem on the volume
       &FAI::build_mkfs_commands("/dev/md$id",
@@ -408,9 +397,7 @@
 
     # create a new volume
     &FAI::push_command( "lvcreate -n $lv -L " . $lv_size->{eff_size} . " $vg",
-      "vg_enabled_$vg,$lv_rm_pre", "run_udev_/dev/$vg/$lv" );
-    &FAI::push_command( "udevsettle --timeout=10", "run_udev_/dev/$vg/$lv",
-      "exist_/dev/$vg/$lv" );
+      "vg_enabled_$vg,$lv_rm_pre", "exist_/dev/$vg/$lv" );
 
     # create the filesystem on the volume
     &FAI::build_mkfs_commands("/dev/$vg/$lv",
@@ -447,16 +434,12 @@
         $type_pre .= ",exist_$d"
       }
     }
-    $type_pre =~ s/^,//;
-    # wait for udev to set up all devices
-    &FAI::push_command( "udevsettle --timeout=10", "$type_pre",
-      "settle_for_vgchange_$vg" );
 
     # create the volume group or add/remove devices
     &FAI::create_volume_group($config);
     # enable the volume group
     &FAI::push_command( "vgchange -a y $vg",
-      "settle_for_vgchange_$vg,vg_created_$vg", "vg_enabled_$vg" );
+      "vg_created_$vg$type_pre", "vg_enabled_$vg" );
 
     # perform all necessary operations on the underlying logical volumes
     &FAI::setup_logical_volumes($config);
@@ -631,15 +614,12 @@
     $part_nr++;
     $FAI::current_config{$disk}{partitions}{$mapped_id}{new_id} = $part_nr;
 
-    my $post = "run_udev_" . &FAI::make_device_name($disk, $part_nr);
+    my $post = "exist_" . &FAI::make_device_name($disk, $part_nr);
     $post .= ",rebuilt_" . &FAI::make_device_name($disk, $part_nr) if
       $FAI::configs{$config}{partitions}{$part_id}{size}{resize};
     # build a parted command to create the partition
     &FAI::push_command( "parted -s $disk mkpart $part_type $fs ${start}B 
${end}B",
       "cleared1_$disk", $post );
-    &FAI::push_command( "udevsettle --timeout=10", "run_udev_" .
-      &FAI::make_device_name($disk, $part_nr), "exist_" .
-      &FAI::make_device_name($disk, $part_nr) );
   }
 }
 
@@ -749,13 +729,9 @@
       # ntfsresize requires device names
       my $eff_size = $part->{size}->{eff_size};
 
-      # wait for udev to set up all devices
-      &FAI::push_command( "udevsettle --timeout=10", "rebuilt_" .
-        &FAI::make_device_name($disk, $p) . $deps, "settle_for_resize_" .
-        &FAI::make_device_name($disk, $p) );
       &FAI::push_command( "yes | ntfsresize -s $eff_size " .
-        &FAI::make_device_name($disk, $p), "settle_for_resize_" .
-        &FAI::make_device_name($disk, $p), "ntfs_ready_for_rm_" .
+        &FAI::make_device_name($disk, $p), "rebuilt_" .
+        &FAI::make_device_name($disk, $p) . $deps, "ntfs_ready_for_rm_" .
         &FAI::make_device_name($disk, $p) );
       &FAI::push_command( "parted -s $disk rm $p", "ntfs_ready_for_rm_" .
         &FAI::make_device_name($disk, $p), "resized_" .
@@ -811,10 +787,7 @@
     $pre = ",exist_" . &FAI::make_device_name($disk, $prev_id) if ($prev_id > 
-1);
     # build a parted command to create the partition
     &FAI::push_command( "parted -s $disk mkpart $part_type $fs ${start}B 
${end}B",
-      "cleared2_$disk$pre", "run_udev_" . &FAI::make_device_name($disk, 
$part_id) );
-    &FAI::push_command( "udevsettle --timeout=10", "run_udev_" . 
-      &FAI::make_device_name($disk, $part_id), "exist_" . 
-      &FAI::make_device_name($disk, $part_id) );
+      "cleared2_$disk$pre", "exist_" . &FAI::make_device_name($disk, $part_id) 
);
     $prev_id = $part_id;
   }
 
Index: trunk/lib/setup-storage/Exec.pm
===================================================================
--- trunk.orig/lib/setup-storage/Exec.pm
+++ trunk/lib/setup-storage/Exec.pm     
@@ -202,7 +202,7 @@
 }
 
################################################################################
 #
-# @brief execute a /bin/bash command, given as string. also catch stderr and
+# @brief execute a shell command, given as string. also catch stderr and
 # stdout, to be passed to the caller function, and also used for error
 # recognition. This execute function does execute the in the error struct
 # defined action, when an error occurs.
@@ -237,7 +237,27 @@
   }
   return "";
 }
+################################################################################
+#
+# @brief Execute a command as in execute_command, but prefix it with udevsettle
+#
+# @return the identifier of the error
+#
+################################################################################
+sub execute_with_udevsettle {
+  my ($command, $stdout, $stderr) = @_;
+  return &execute_command("udevsettle --timeout 10 && $command", $stdout,
+    $stderr);
+}
 
+################################################################################
+#
+# @brief Execute a command that is known to be read-only and thus acceptable to
+# be run despite dry_run mode
+#
+# @return the identifier of the error
+#
+################################################################################
 sub execute_ro_command {
   my ($command, $stdout, $stderr) = @_;
 

Attachment: pgpyYBzqubxbj.pgp
Description: PGP signature


--- End Message ---
--- Begin Message ---
Source: fai
Source-Version: 3.2.14

We believe that the bug you reported is fixed in the latest version of
fai, which is due to be installed in the Debian FTP archive:

fai-client_3.2.14_all.deb
  to pool/main/f/fai/fai-client_3.2.14_all.deb
fai-doc_3.2.14_all.deb
  to pool/main/f/fai/fai-doc_3.2.14_all.deb
fai-nfsroot_3.2.14_all.deb
  to pool/main/f/fai/fai-nfsroot_3.2.14_all.deb
fai-quickstart_3.2.14_all.deb
  to pool/main/f/fai/fai-quickstart_3.2.14_all.deb
fai-server_3.2.14_all.deb
  to pool/main/f/fai/fai-server_3.2.14_all.deb
fai_3.2.14.dsc
  to pool/main/f/fai/fai_3.2.14.dsc
fai_3.2.14.tar.gz
  to pool/main/f/fai/fai_3.2.14.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Thomas Lange <[EMAIL PROTECTED]> (supplier of updated fai package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 28 Oct 2008 10:32:20 +0100
Source: fai
Binary: fai-client fai-doc fai-server fai-quickstart fai-nfsroot
Architecture: source all
Version: 3.2.14
Distribution: unstable
Urgency: low
Maintainer: Thomas Lange <[EMAIL PROTECTED]>
Changed-By: Thomas Lange <[EMAIL PROTECTED]>
Description: 
 fai-client - Fully Automatic Installation client package
 fai-doc    - Documentation for FAI
 fai-nfsroot - Fully Automatic Installation nfsroot package
 fai-quickstart - Fully Automatic Installation quickstart package
 fai-server - Fully Automatic Installation server package
Closes: 361524 489546 503729
Changes: 
 fai (3.2.14) unstable; urgency=low
 .
   * fai-guide.sgml: document behaviour of LOGSERVER (closes: #361524)
   * install_packages: fix usage of option -n (closes: #489546)
   * setup-storage, Commands.pm, Exec.pm: Call udevsettle before doing any
     of the commands to avoid all the possible pitfalls, simplyfies the
     code quite a bit. (closes: #503729)
Checksums-Sha1: 
 2df9ad0e36bae9b44dbd0213d42fa4c0327df573 997 fai_3.2.14.dsc
 ba37e609bb294f0da462b1bd2faf64b7d2d0dc94 264980 fai_3.2.14.tar.gz
 e50b78b2a922199210120ae0b63dbb57156e073b 145544 fai-client_3.2.14_all.deb
 82b6089d8a389f0566061f27fb47a1337e9d72a2 564618 fai-doc_3.2.14_all.deb
 c0810e887b4f785f129d63920b99ab8cf49f3f79 51624 fai-server_3.2.14_all.deb
 66e88e0e1e029f06702c7edda28708e93923df99 1900 fai-quickstart_3.2.14_all.deb
 122fec215f1ad1c3a70ad41cab4e4cd0db1c8053 53212 fai-nfsroot_3.2.14_all.deb
Checksums-Sha256: 
 9e63d79cc28cfc8478d9760d050af993c3e9fd48484141e3832bec40c770e491 997 
fai_3.2.14.dsc
 9c6f7a341dbac82301e885d25a52b0d1ccdeb2cdf3da2fe7f7e851bd2dd936e1 264980 
fai_3.2.14.tar.gz
 443396642c5ab3620cfbc1f152bef53f74d29969e9d57d8c4854d3485e0254f8 145544 
fai-client_3.2.14_all.deb
 b7ebc20cc4e084be5588a5132b8b36dae53f8eb9d99335554a36aeeb112e93fa 564618 
fai-doc_3.2.14_all.deb
 fd99848fd309f6ddc48848f93409cd30a25382a67a6f5a470b9938b9301cd03c 51624 
fai-server_3.2.14_all.deb
 5f1f0e87ee9ece96bd933b1c36051672d600eceed3997231f902ce268c00e9b0 1900 
fai-quickstart_3.2.14_all.deb
 76a37dbd270fb597125a55430c9ee8ed08aa2719045bd26f6c1926c2c12ebf9b 53212 
fai-nfsroot_3.2.14_all.deb
Files: 
 1e67889c02a57361af3fec637abecd85 997 admin extra fai_3.2.14.dsc
 85caede2cd8d454f290a0e02ae68b9eb 264980 admin extra fai_3.2.14.tar.gz
 a9ca4ca596b1abb441aa24712c2d70e1 145544 admin extra fai-client_3.2.14_all.deb
 c3c2713cdd6273d8505af07d99be59c8 564618 doc extra fai-doc_3.2.14_all.deb
 dd4423c96a6554b19b45d2a43ac9a996 51624 admin extra fai-server_3.2.14_all.deb
 a8c6582acb46d0cf872a225fb6d6d1e8 1900 admin extra fai-quickstart_3.2.14_all.deb
 d642dff6d41a312daf0c7d3ceb005749 53212 admin extra fai-nfsroot_3.2.14_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFJBt4I3BPlTqubZv0RAiY7AJwJ3V28N2pmCeM5RvUk3hWa9UNaBQCgnD9T
ZJ/Gq6M+uLcJI7Im2aXlyt4=
=RKwG
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to