Hi, attached you can find various patches to fix bugs in client tools for openSUSE
* 0001-BuildRequire-docbook-style-xsl-only-on-redhat.patch docbook-style-xsl does not exist in openSUSE * 0002 - 0005 no-use-of-var-lock-subsys-anymore The directory does not exist anymore on openSUSE and it is not needed when using checkproc * 0006-package-solaris-converter.patch also openSUSE should include this files * 0007-no-hal-for-openSUSE-11.4.patch openSUSE > 11.4 do not have hal anymore. Use gudev like fedora. * 0008-check-if-etc-sysconfig-network-is-a-file.patch On openSUSE distribution we do not have a file named /etc/sysconfig/network. Check if it is a file and use the other methods to find the hostname if not. * 0009-check-if-system-id-has-changed.patch check if system id has changed. Helps with --force registration in short frequences. * 0010-do-not-start-rhnsd-in-runlevel-2-which-has-no-networ.patch runlevel 2 has no network, but it is required. So do not start rhnsd in runlevel 2. Would be good, if they could be included in spacewalk 1.8 -- Regards Michael Calmer -------------------------------------------------------------------------- Michael Calmer SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg T: +49 (0) 911 74053 0 F: +49 (0) 911 74053575 - e-mail: michael.cal...@suse.com -------------------------------------------------------------------------- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer HRB 16746 (AG Nürnberg)
>From 0f2dc898aeace073e20162b4cfb656ca3ad5523d Mon Sep 17 00:00:00 2001 From: Michael Calmer <m...@suse.de> Date: Sun, 22 Apr 2012 16:33:37 +0200 Subject: [PATCH 01/10] BuildRequire docbook-style-xsl only on redhat --- spacewalk/pylint/spacewalk-pylint.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacewalk/pylint/spacewalk-pylint.spec b/spacewalk/pylint/spacewalk-pylint.spec index 1d19687..76e9427 100644 --- a/spacewalk/pylint/spacewalk-pylint.spec +++ b/spacewalk/pylint/spacewalk-pylint.spec @@ -13,7 +13,7 @@ BuildArch: noarch Requires: pylint BuildRequires: asciidoc BuildRequires: libxslt -%if 0%{?rhel} < 6 +%if 0%{?rhel} && 0%{?rhel} < 6 BuildRequires: docbook-style-xsl %endif -- 1.7.12.4
>From 575b0fc9bfcebea606601b05ee6ce4875c91ed28 Mon Sep 17 00:00:00 2001 From: Michael Calmer <m...@suse.de> Date: Sat, 6 Oct 2012 17:29:59 +0200 Subject: [PATCH 06/10] package solaris converter --- client/tools/rhnpush/rhnpush.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/tools/rhnpush/rhnpush.spec b/client/tools/rhnpush/rhnpush.spec index 1db72d8..df79a1a 100644 --- a/client/tools/rhnpush/rhnpush.spec +++ b/client/tools/rhnpush/rhnpush.spec @@ -69,7 +69,7 @@ spacewalk-pylint $RPM_BUILD_ROOT%{rhnroot} %attr(755,root,root) %{_bindir}/rpm2mpm %config(noreplace) %attr(644,root,root) %{_sysconfdir}/sysconfig/rhn/rhnpushrc %{_mandir}/man8/rhnpush.8* -%if 0%{?fedora} || 0%{?rhel} > 5 +%if 0%{?fedora} || 0%{?rhel} > 5 || 0%{?suse_version} %attr(755,root,root) %{_bindir}/solaris2mpm %{_mandir}/man8/solaris2mpm.8* %endif -- 1.7.12.4
>From 7aedce61a7b65ee6e8c8cf550376dca0af96819b Mon Sep 17 00:00:00 2001 From: Michael Calmer <m...@suse.de> Date: Sat, 20 Oct 2012 15:45:05 +0200 Subject: [PATCH 07/10] no hal for openSUSE >= 11.4 --- client/rhel/rhn-client-tools/rhn-client-tools.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec index 75e32f4..9172738 100644 --- a/client/rhel/rhn-client-tools/rhn-client-tools.spec +++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec @@ -23,7 +23,7 @@ Requires: dbus-1-python %else Requires: dbus-python %endif -%if 0%{?fedora} || 0%{?rhel} > 5 +%if 0%{?fedora} || 0%{?rhel} > 5 || 0%{?suse_version} >= 1140 Requires: python-gudev Requires: python-hwdata %else @@ -143,7 +143,7 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/up2date mkdir -pm700 $RPM_BUILD_ROOT%{_localstatedir}/spool/up2date touch $RPM_BUILD_ROOT%{_localstatedir}/spool/up2date/loginAuth.pkl -%if 0%{?fedora} || 0%{?rhel} > 5 +%if 0%{?fedora} || 0%{?rhel} > 5 || 0%{?suse_version} >= 1140 rm $RPM_BUILD_ROOT%{_datadir}/rhn/up2date_client/hardware_hal.* %else rm $RPM_BUILD_ROOT%{_datadir}/rhn/up2date_client/hardware_gudev.* -- 1.7.12.4
>From ea5e8fe104fbd7fcda135b8d936cce7f73dd9fb9 Mon Sep 17 00:00:00 2001 From: Michael Calmer <m...@suse.de> Date: Sat, 5 May 2012 15:10:09 +0200 Subject: [PATCH 02/10] no use of /var/lock/subsys/ anymore --- client/rhel/rhnsd/rhnsd.init.SUSE | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/rhel/rhnsd/rhnsd.init.SUSE b/client/rhel/rhnsd/rhnsd.init.SUSE index e2faf8e..d02a5af 100644 --- a/client/rhel/rhnsd/rhnsd.init.SUSE +++ b/client/rhel/rhnsd/rhnsd.init.SUSE @@ -66,8 +66,6 @@ rc_reset start() { echo -n $"Starting Red Hat Network Daemon: " startproc -p $RHNSD_PIDFILE $RHNSD - rc_status - touch /var/lock/subsys/rhnsd rc_status -v } @@ -75,7 +73,6 @@ stop() { echo -n $"Stopping Red Hat Network Daemon: " killproc -p $RHNSD_PIDFILE $RHNSD rc_status -v - rm -f /var/lock/subsys/rhnsd } # See how we were called. @@ -96,10 +93,13 @@ case "$1" in start ;; condrestart|try-restart) - if [ -f /var/lock/subsys/rhnsd ]; then - stop - start - fi + $0 status + if test $? = 0; then + $0 restart + else + rc_reset + fi + rc_status ;; reload) echo -n $"Reloading Red Hat Network Daemon: " -- 1.7.12.4
>From d498cb05650fba3386906c678df5a60372bc6f16 Mon Sep 17 00:00:00 2001 From: Michael Calmer <m...@suse.de> Date: Sat, 5 May 2012 15:14:25 +0200 Subject: [PATCH 03/10] no use of /var/lock/subsys/ anymore --- client/tools/osad/prog.init.SUSE | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/tools/osad/prog.init.SUSE b/client/tools/osad/prog.init.SUSE index c1662a3..a99e225 100644 --- a/client/tools/osad/prog.init.SUSE +++ b/client/tools/osad/prog.init.SUSE @@ -30,8 +30,6 @@ start() { # Start daemon echo -n "Starting $prog: " startproc -p $PIDFILE $script --pid-file="$PIDFILE" - rc_status - touch /var/lock/subsys/$prog rc_status -v } @@ -39,7 +37,6 @@ start() { stop() { # Stop daemon echo -n "Shutting down $prog: " - rm -f /var/lock/subsys/$prog killproc -p $PIDFILE $script rc_status -v } @@ -62,10 +59,13 @@ case "$1" in rc_status -v ;; condrestart|try-restart) - if [ -f /var/lock/subsys/$prog ]; then - stop - start + $0 status + if test $? = 0; then + $0 restart + else + rc_reset fi + rc_status ;; *) echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}" -- 1.7.12.4
>From d8623337230df060b6c6c820201416f4c76679c4 Mon Sep 17 00:00:00 2001 From: Michael Calmer <m...@suse.de> Date: Sat, 20 Oct 2012 15:48:09 +0200 Subject: [PATCH 08/10] check if /etc/sysconfig/network is a file Other Linux distributions may not have a file named /etc/sysconfig/network. Check if it is a file and use the other methods to find the hostname. --- client/rhel/rhn-client-tools/src/up2date_client/hardware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/rhel/rhn-client-tools/src/up2date_client/hardware.py b/client/rhel/rhn-client-tools/src/up2date_client/hardware.py index ba53256..41856e4 100644 --- a/client/rhel/rhn-client-tools/src/up2date_client/hardware.py +++ b/client/rhel/rhn-client-tools/src/up2date_client/hardware.py @@ -453,7 +453,7 @@ def findHostByRoute(): # Override hostname with the one in /etc/sysconfig/network # for bz# 457953 - if os.access("/etc/sysconfig/network", os.R_OK): + if os.path.isfile("/etc/sysconfig/network") and os.access("/etc/sysconfig/network", os.R_OK): networkinfo = open("/etc/sysconfig/network", "r").readlines() for info in networkinfo: -- 1.7.12.4
>From 8bf12130aff229b1c22d3adf50fa9564f7c111a6 Mon Sep 17 00:00:00 2001 From: Michael Calmer <m...@suse.de> Date: Sat, 5 May 2012 15:29:24 +0200 Subject: [PATCH 04/10] no use of /var/lock/subsys/ anymore --- .../scripts/rhn-virtualization-host.SUSE | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/client/tools/rhn-virtualization/scripts/rhn-virtualization-host.SUSE b/client/tools/rhn-virtualization/scripts/rhn-virtualization-host.SUSE index da66d86..04ae45a 100644 --- a/client/tools/rhn-virtualization/scripts/rhn-virtualization-host.SUSE +++ b/client/tools/rhn-virtualization/scripts/rhn-virtualization-host.SUSE @@ -41,7 +41,6 @@ start() { fi done - touch /var/lock/subsys/rhn-virtualization rc_status -v } @@ -55,28 +54,29 @@ stop() { fi done - rm -f /var/lock/subsys/rhn-virtualization rc_status -v } status() { found_guests=0 + rc_reset for NAME in $list_of_files; do found_guests=1 dom_name=$(eval $get_name $auto_dir/$NAME) dom_state=$(virsh domstate $dom_name 2> /dev/null) + rc_check if [ $? -eq 0 ]; then echo "$dom_name: $dom_state" else echo "Error getting the status for $dom_name." - rc_check fi done if [ $found_guests -eq 0 ]; then echo "No guest configurations symlinked in $auto_dir." + rc_status -u fi rc_status -v @@ -99,10 +99,13 @@ case "$1" in start ;; condrestart|try-restart) - if [ -f /var/lock/subsys/rhn-virtualization ]; then - stop - start - fi + $0 status + if test $? = 0; then + $0 restart + else + rc_reset + fi + rc_status ;; status) status -- 1.7.12.4
>From 70c87a9d5d1015098d3629a4d46df9d8f24d8522 Mon Sep 17 00:00:00 2001 From: Michael Calmer <m...@suse.de> Date: Sat, 20 Oct 2012 15:51:17 +0200 Subject: [PATCH 09/10] check if system id has changed --- client/rhel/rhn-client-tools/src/up2date_client/up2dateAuth.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/rhel/rhn-client-tools/src/up2date_client/up2dateAuth.py b/client/rhel/rhn-client-tools/src/up2date_client/up2dateAuth.py index d0d02f4..ef84f8b 100644 --- a/client/rhel/rhn-client-tools/src/up2date_client/up2dateAuth.py +++ b/client/rhel/rhn-client-tools/src/up2date_client/up2dateAuth.py @@ -127,6 +127,15 @@ def readCachedLogin(): pcklAuth.close() return False pcklAuth.close() + # Check if system_id has changed + try: + idVer = rpclib.xmlrpclib.loads(getSystemId())[0][0]['system_id'] + cidVer = "ID-%s" % data['loginInfo']['X-RHN-Server-Id'] + if idVer != cidVer: + log.log_debug("system id version changed: %s vs %s" % (idVer, cidVer)) + return False + except: + pass createdTime = data['time'] li = data['loginInfo'] currentTime = time.time() -- 1.7.12.4
>From 04aa162be3d066f40189f71e771b295ad5587139 Mon Sep 17 00:00:00 2001 From: Michael Calmer <m...@suse.de> Date: Sat, 5 May 2012 15:48:45 +0200 Subject: [PATCH 05/10] no use of /var/lock/subsys/ anymore --- monitoring/rhnmd/rhnmd.init.SUSE | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/monitoring/rhnmd/rhnmd.init.SUSE b/monitoring/rhnmd/rhnmd.init.SUSE index a1662f6..a95b652 100644 --- a/monitoring/rhnmd/rhnmd.init.SUSE +++ b/monitoring/rhnmd/rhnmd.init.SUSE @@ -52,14 +52,12 @@ start() fi startproc -p $SSHD_PIDFILE $SSHD -f /etc/nocpulse/rhnmd_config -o "PidFile=$SSHD_PIDFILE" rc_status - touch /var/lock/subsys/rhnmd rc_status -v } stop() { echo -n $"Stopping $prog:" - rm -f /var/lock/subsys/rhnmd killproc -p $SSHD_PIDFILE -TERM $SSHD rc_status -v } @@ -86,15 +84,19 @@ case "$1" in reload ;; condrestart|try-restart) - if [ -f /var/lock/subsys/rhnmd ] ; then - do_restart_sanity_check - if [ "$RETVAL" = 0 ] ; then - stop - # avoid race - sleep 3 - start - fi - fi + $0 status + if test $? = 0; then + do_restart_sanity_check + if [ "$RETVAL" = 0 ] ; then + $0 stop + # avoid race + sleep 3 + $0 start + fi + else + rc_reset + fi + rc_status ;; status) echo -n "Checking for service rhnmd: " @@ -102,6 +104,6 @@ case "$1" in rc_status -v ;; *) - echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" + echo $"Usage: $0 {start|stop|restart|reload|condrestart|try-restart|status}" esac rc_exit -- 1.7.12.4
>From 13bd9994ee75d332a0669d2117f511f45089fc5a Mon Sep 17 00:00:00 2001 From: Michael Calmer <m...@suse.de> Date: Wed, 31 Oct 2012 10:00:34 +0100 Subject: [PATCH 10/10] do not start rhnsd in runlevel 2 which has no network --- client/rhel/rhnsd/rhnsd.init.SUSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/rhel/rhnsd/rhnsd.init.SUSE b/client/rhel/rhnsd/rhnsd.init.SUSE index d02a5af..a909579 100644 --- a/client/rhel/rhnsd/rhnsd.init.SUSE +++ b/client/rhel/rhnsd/rhnsd.init.SUSE @@ -17,7 +17,7 @@ # Provides: rhnsd # Required-Start: $local_fs $network $remote_fs $named $time # Required-Stop: $local_fs $network $remote_fs $named -# Default-Start: 2 3 5 +# Default-Start: 3 5 # Default-Stop: 0 1 6 # Short-Description: Starts the Red Hat Network Daemon # Description: This is a daemon which handles the task of connecting -- 1.7.12.4
_______________________________________________ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel