java/conf/cobbler/snippets/keep_system_id | 12 +-----------
java/conf/cobbler/snippets/post_reactivation_key | 15 +++++++++------
2 files changed, 10 insertions(+), 17 deletions(-)
New commits:
commit d3e9593c5a070f48de07f3cd1a2cf9b2fd7dca4d
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Mon Sep 27 17:34:52 2010 -0400
637696 - fixing issue where kickstart could hang, either because of a rhel 5.5 kernel
panic, or because RHEL 6 does not allow pre-scripts to continue running in the background
diff --git a/java/conf/cobbler/snippets/keep_system_id
b/java/conf/cobbler/snippets/keep_system_id
index c27e05d..2f05c66 100644
--- a/java/conf/cobbler/snippets/keep_system_id
+++ b/java/conf/cobbler/snippets/keep_system_id
@@ -11,7 +11,7 @@ mkdir -p /tmp/rhn
drives=$(list-harddrives | awk '{print $1}')
for disk in $drives; do
- DISKS="$DISKS $(fdisk -l /dev/$disk | awk '/^\/dev/{print $1}')"
+ DISKS="$DISKS $(fdisk -l /dev/$disk | grep -v "swap\|LVM\|Extended" |
awk '/^\/dev/{print $1}')"
done
# Try to find the keys on ordinary partitions
@@ -64,14 +64,4 @@ if [ "$rhn_keys_found" = "no" ]; then
done
fi
-# Loop until the RHN rpm is installed
-if [ "$rhn_keys_found" = "yes" ]; then
- while : ; do
- sleep 10
- if [ -d /mnt/sysimage/root ] ; then
- cp -af /tmp/rhn/* /mnt/sysimage/root/systemid.old
- break
- fi
- done &
-fi
#end raw
diff --git a/java/conf/cobbler/snippets/post_reactivation_key
b/java/conf/cobbler/snippets/post_reactivation_key
index 9b7a972..2a5e0fc 100644
--- a/java/conf/cobbler/snippets/post_reactivation_key
+++ b/java/conf/cobbler/snippets/post_reactivation_key
@@ -1,23 +1,26 @@
-%post --interpreter /usr/bin/python
+%post --nochroot --interpreter /usr/bin/python
import xmlrpclib
+import shutil
import os
import os.path
-system_id = "/root/systemid.old"
+old_system_id = "/tmp/rhn/systemid"
+new_system_id = "/mnt/sysimage/root/systemid.old"
try:
new_keys = "$redhat_management_key"
for key in new_keys.split(','):
if key.startswith('re-'):
os.exit(0)
- if os.path.exists(system_id):
+ if os.path.exists(old_system_id):
client = xmlrpclib.Server("http://$http_server/rpc/api")
- key = client.system.obtain_reactivation_key(open(system_id).read())
- f = open("/tmp/key","w")
+ key = client.system.obtain_reactivation_key(open(old_system_id).read())
+ f = open("/mnt/sysimage/tmp/key","w")
f.write(key)
f.close()
+ shutil.copy(old_system_id, new_system_id)
except:
# xml rpc due to a old/bad system id
# we don't care about those
- # we'll register those as new.
+ # we'll register those as new.
pass
Show replies by date