Hello,

On the system it had :
systemIdPath=/etc/sysconfig/rhn/systemid.save

Most likely due to re-installs of rhn-client-tools or re-registrations the systemid file was saves as systemid.save and it was being used in up2date file. But in such setup configure-proxy.sh fails with the error "ERROR: RHN Proxy does not appear to be registered"


Attached is the proposed patch for configure-proxy.sh to refer the systemIdPath in up2date file instead of static systemid file.

Thanks !
Paresh
>From b744b489fa369b6f4772814d0065a366ce7ac46d Mon Sep 17 00:00:00 2001
From: Paresh Mutha <pmu...@pmutha.pnq.redhat.com>
Date: Tue, 24 Sep 2013 15:44:36 +0530
Subject: [PATCH] refer systemIdPath from up2date config

Signed-off-by: Paresh Mutha <pmu...@pmutha.pnq.redhat.com>
---
 proxy/installer/configure-proxy.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/proxy/installer/configure-proxy.sh b/proxy/installer/configure-proxy.sh
index 3fb2a74..92137c0 100755
--- a/proxy/installer/configure-proxy.sh
+++ b/proxy/installer/configure-proxy.sh
@@ -253,13 +253,14 @@ HTTPDCONFD_DIR=/etc/httpd/conf.d
 HTMLPUB_DIR=/var/www/html/pub
 JABBERD_DIR=/etc/jabberd
 SQUID_DIR=/etc/squid
+SYSTEMID_PATH=`PYTHONPATH='/usr/share/rhn' python -c "from up2date_client import config; cfg = config.initUp2dateConfig(); print cfg['systemIdPath'] "`
 
-if [ ! -r $SYSCONFIG_DIR/systemid ]; then
+if [ ! -r SYSTEMID_PATH ]; then
 	echo ERROR: Spacewalk Proxy does not appear to be registered
 	exit 2
 fi
 
-SYSTEM_ID=$(/usr/bin/xsltproc /usr/share/rhn/get_system_id.xslt $SYSCONFIG_DIR/systemid | cut -d- -f2)
+SYSTEM_ID=$(/usr/bin/xsltproc /usr/share/rhn/get_system_id.xslt $SYSTEMID_PATH | cut -d- -f2)
 
 DIR=/usr/share/doc/proxy/conf-template
 HOSTNAME=$(hostname)
@@ -468,8 +469,8 @@ if [ $MONITORING -eq 0 ]; then
 fi
 
 # systemid need to be readable by apache/proxy
-chown root:apache $SYSCONFIG_DIR/systemid
-chmod 0640 $SYSCONFIG_DIR/systemid
+chown root:apache $SYSTEMID_PATH
+chmod 0640 $SYSTEMID_PATH
 
 #Setup the cobbler stuff, needed to use koan through a proxy
 PROTO="http";
-- 
1.8.3.1

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to