Hi,

I've recently found a problem with the way SystemImager handles hostnames. I have some machines with all upper case hostnames in the DNS (PC034, for example), but in the cluster.xml file I defined the range in lower case (pc001-pc040). Then when I try to install the machine, SI doesn't get the image name from cluster.txt because of the different case.

If I'm not wrong, hostnames should be case insensitive, so I've attached a patch against trunk (r4466) that fixes the problem (only tested with version 4.0.2).

I suppose this implies that script names should be also case insensitive, but I'm not sure if there is any case in which it shouldn't. Then, at least choose_autoinstall_script() from initrd_source/skel/etc/init.d/functions should be also modified.

The image server is a Fedora Core 5 with SystemImager 4.0.2 and the client is installed using a CD.

Cheers,
Àlex
Index: sbin/si_updateclient
===================================================================
--- sbin/si_updateclient	(revision 4466)
+++ sbin/si_updateclient	(working copy)
@@ -471,7 +471,7 @@
             unlink($tmpfile);
             exit(1);
         }
-        chomp($image = `grep "^$hostname:" $tmpfile | cut -d: -f3 | grep -v '^[[:space:]]*\$' | sed -ne '1p'`);
+        chomp($image = `grep -i "^$hostname:" $tmpfile | cut -d: -f3 | grep -v '^[[:space:]]*\$' | sed -ne '1p'`);
         unless ($image) {
             print STDERR "error: couldn't find a valid image for: $hostname!\n";
             print STDERR "Try to specify --image and/or --override from command line.\n";
@@ -480,7 +480,7 @@
         }
         unless (@overrides) {
             push(@overrides, split(/\s+/, `sed -ne 's/^# global_override=:\\([^:]*\\):\$/\\1/p' $tmpfile`));
-            push(@overrides, reverse split(/\s+/, `grep "^$hostname:" $tmpfile | cut -d: -f4 | tr "\n" ' '`));
+            push(@overrides, reverse split(/\s+/, `grep -i "^$hostname:" $tmpfile | cut -d: -f4 | tr "\n" ' '`));
         }
         unlink($tmpfile);
     }
Index: initrd_source/skel/etc/init.d/functions
===================================================================
--- initrd_source/skel/etc/init.d/functions	(revision 4466)
+++ initrd_source/skel/etc/init.d/functions	(working copy)
@@ -1239,11 +1239,11 @@
 get_group_name() {
     if [ -f ${SCRIPTS_DIR}/cluster.txt ]; then
         [ -z "$GROUPNAMES" ] && \
-            GROUPNAMES=`unique $(grep "^${HOSTNAME}:" ${SCRIPTS_DIR}/cluster.txt | cut -d: -f2 | tr "\n" ' ')`
+            GROUPNAMES=`unique $(grep -i "^${HOSTNAME}:" ${SCRIPTS_DIR}/cluster.txt | cut -d: -f2 | tr "\n" ' ')`
         [ -z "$IMAGENAME" ] && \
-            IMAGENAME=`grep "^${HOSTNAME}:" ${SCRIPTS_DIR}/cluster.txt | cut -d: -f3 | grep -v '^[[:space:]]*$' | sed -ne '1p'`
+            IMAGENAME=`grep -i "^${HOSTNAME}:" ${SCRIPTS_DIR}/cluster.txt | cut -d: -f3 | grep -v '^[[:space:]]*$' | sed -ne '1p'`
         if [ -z "$GROUP_OVERRIDES" ]; then
-            GROUP_OVERRIDES=`reverse $(unique $(grep "^${HOSTNAME}:" ${SCRIPTS_DIR}/cluster.txt | cut -d: -f4 | tr "\n" ' '))`
+            GROUP_OVERRIDES=`reverse $(unique $(grep -i "^${HOSTNAME}:" ${SCRIPTS_DIR}/cluster.txt | cut -d: -f4 | tr "\n" ' '))`
             # Add the global override on top (least important).
             GROUP_OVERRIDES="`sed -ne 's/^# global_override=:\([^:]*\):$/\1/p' ${SCRIPTS_DIR}/cluster.txt` $GROUP_OVERRIDES"
         fi
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
sisuite-users mailing list
sisuite-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sisuite-users

Reply via email to