[Spacewalk-list] Fix to re-registering Spacewalk Clients

Jon Miller jonebird at gmail.com
Fri Aug 23 00:32:19 UTC 2013


We have had a issue taking advantage of the Spacewalk profile feature that
allows you to preserve a system profile when rebuilding a machine. (The
Spacewalk Profile option "Re-connect to the existing system profile. Do not
create a new system profile" found in the 'System Details' tab)

The problem was related to the fact that we are using LVM for our disks and
that the lvm commands in the built-in snippet were not working as
expected. Our solution is rather simplistic but it works.  We believe this is
similar to an issue reported by another RedHat customer[1].

I have included the patch below. It would be nice it this could be included
in a future update to spacewalk-java package.

-- 
Jon Miller

[1]: https://access.redhat.com/site/solutions/395093

--- /var/lib/rhn/kickstarts/snippets/keep_system_id.orig        2013-08-22 16:49:52.000000000 -0700
+++ /var/lib/rhn/kickstarts/snippets/keep_system_id     2013-08-22 16:51:18.000000000 -0700
@@ -30,14 +30,14 @@
 
 # Try LVM if that didn't work
 if [ "$rhn_keys_found" = "no" ]; then
-    lvm lvmdiskscan
-    vgs=$(lvm vgs | tail -n +2 | awk '{ print $1 }')
+    echo "" | lvm lvmdiskscan
+    vgs=$(echo "" | lvm vgs | tail -n +2 | awk '{ print $1 }')
     for vg in $vgs; do
         # Activate any VG we found
-        lvm vgchange -ay $vg
+        echo "" | lvm vgchange -ay $vg
     done
     
-    lvs=$(lvm lvs | tail -n +2 | awk '{ print "/dev/" $2 "/" $1 }')
+    lvs=$(echo "" | lvm lvs | tail -n +2 | awk '{ print "/dev/" $2 "/" $1 }')
     for lv in $lvs; do
         tmpdir=$(mktemp -d findkeys.XXXXXX)
         mkdir -p /tmp/${tmpdir}
@@ -56,7 +56,7 @@
     
     # And clean up..
     for vg in $vgs; do
-        lvm vgchange -an $vg
+        echo "" | lvm vgchange -an $vg
     done
 fi




More information about the Spacewalk-list mailing list