Re: [Spacewalk-devel] [PATCH] rhn-custom-info

2011-04-08 Thread Miroslav Suchý
On 04/07/2011 04:02 PM, Michael Calmer wrote:
 Hi,
 
 during some tests of the master branch I realized some issues with rhn-custom-
 info. It seems that some reorganization of the code introduced some bugs in 
 this package.
 
 I have created a patch which is attached.

Thanks for noticing that.
Patch committed.
I added one more enhancement:

-if isinstance(ca, str) or isinstance(ca, unicode):
+if isinstance(ca, basestring):

-- 
Miroslav Suchy
Red Hat Satellite Engineering

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


[Spacewalk-devel] [Fwd: Oracle Database 11g Express Edition Beta!]

2011-04-08 Thread Cliff Perry
FYI - this information may be useful for spacewalk OracleXE users. Do we 
care to try testing Spacewalk 1.4 with the beta 11g XE?


 Original Message 
Subject:Oracle Database 11g Express Edition Beta!
Date:   Thu, 7 Apr 2011 22:19:56 -0700
From:   Oracle's Database Application Developer Newsletter
re...@oracle-mail.com
Reply-To:   re...@oracle-mail.com
To: cpe...@redhat.com


*April 2011*

*Database Application Developer Newsletter*

*Oracle Database 11/g/ Express Edition Beta!*

You've waited patiently, and now that patience pays off: the Oracle
Database 11/g/ Express Edition (XE) Beta
http://www.oracle.com/technetwork/database/express-edition/11gxe-beta-download-302519.html?msgid=3-3822972261 


release is here. Download it and give us your feedback today!

Just as you expect, Oracle Database 11/g/ XE brings you an entry-level,
small-footprint RDBMS based on the Oracle Database 11/g/ Release 2
codebase that's free to develop on, deploy, and distribute. It's a great
way to get started with 11/g/ Release 2 features like Edition-Based
Redefinition!

— The Oracle Technology Network Team (See Team Blog
http://blogs.oracle.com/otn?msgid=3-3822972261)



In other news...
[...snip...]

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

[Spacewalk-devel] [PATCH] build rhn-client-tools on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

I spend the last week to build the spacewalk client tools on openSUSE and 
create a project in openSUSE build service.

 http://download.opensuse.org/repositories/systemsmanagement:/spacewalk/

It is based on current git master and I want to provide you the patches.
Mainly I modified the specfile to get the different RPM names for SUSE in it.
Additionally the services got a SUSE specific specfile which is used, if the
package compiles on a SUSE distribution. 
If you prefer a LSB specfile which run on RedHat,Fedora and SUSE, please tell 
me. I will try to create one and I hope you can help to test them on Fedora 
and RedHat.

I will write a seperate mail for every package which hopefully helps to manage 
the answers and comments easier.

rhn-client-tools:

0001-get-hostname-on-not-RedHat-systems.patch:
On SUSE /etc/sysconfig/network is a directory and not a file which contains 
the hostname. So I added a check if it is a file and use the following code to 
find the hostname. Another special thing on SUSE is, that gethostbyname return 
only the (short) hostname, not the FQDN. Therefor I added a test, if hostname 
contains a .. If not, find the hostname using the socket class.

0002-enhance-getOSVersionAndRelease-to-find-SUSE-distribu.patch:
Add code to make _getOSVerionAndRelease work on SUSE

0003-modify-spec-file-to-build-on-SUSE.patch:
Specfile work. Use SUSE rpm names and add some directories to the filelist 
which does not exist on SUSE or does not exist during build.

0004-Check-if-system_id-has-changed.patch:
up2dateAuth.readCachedLogin() seems not to check, if the systemid has changed 
and the cache file is invalid. 

-- 
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: Markus Rex, HRB 16746 (AG Nürnberg)
From 59d44ce683dbfc933baeec4bf92a4a415c225936 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 11:10:55 +0200
Subject: [PATCH 01/17] get hostname on not RedHat systems

Other Linux distributions may not have a file named /etc/sysconfig/network.
So we should check if it is a file and use the other methods to
find the hostname.
Additionally let's check if the found hostname contains a . .
If not, let's find the hostname by Route.
---
 .../src/up2date_client/hardware.py |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

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 ca80e5b..f299bc2 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
@@ -429,13 +429,13 @@ def findHostByRoute():
 except:
 s.close()
 continue
-
-# Override hostname with the one in /etc/sysconfig/network 
+
+# 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:
 if not len(info):
 continue
@@ -489,10 +489,11 @@ def read_network():
 
 
 if netdict['hostname'] == 'localhost.localdomain' or \
+. not in netdict['hostname'] or \
 netdict['ipaddr'] == 127.0.0.1:
 hostname, ipaddr = findHostByRoute()
 
-if netdict['hostname'] == 'localhost.localdomain':
+if netdict['hostname'] == 'localhost.localdomain' or . not in netdict['hostname']:
 netdict['hostname'] = hostname
 if netdict['ipaddr'] == 127.0.0.1:
 netdict['ipaddr'] = ipaddr
-- 
1.7.3.4

From 39a69260d0bafc78b3bb8c6dba7dd25031821893 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 11:12:46 +0200
Subject: [PATCH 03/17] modify spec file to build on SUSE

---
 client/rhel/rhn-client-tools/rhn-client-tools.spec |   45 +++-
 1 files changed, 44 insertions(+), 1 deletions(-)

diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index dfe8f5f..0a061a2 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -22,17 +22,30 @@ Requires: python-ethtool = 0.4
 %endif
 Requires: gnupg
 Requires: sh-utils
+%if 0%{?suse_version}
+Requires: dbus-1-python
+%else
 Requires: dbus-python
+%endif
 %if 0%{?fedora}  12 || 0%{?rhel}  5
 Requires: python-gudev
 Requires: python-hwdata
 %else
 Requires: hal = 0.5.8.1-52
 %endif
+%if 0%{?suse_version}

[Spacewalk-devel] [PATCH] build rhnsd on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch to build and run rhnsd on openSUSE.

0005-changes-to-build-rhnsd-on-SUSE.patch:
- specfile work
- provide SUSE init script 

-- 
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: Markus Rex, HRB 16746 (AG Nürnberg)
From 74c43ea440c79538a4b290aac5040ac5bc39c547 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 14:27:53 +0200
Subject: [PATCH 05/17] changes to build rhnsd on SUSE

- modify specfile
- add and install init script for SUSE
---
 client/rhel/rhnsd/rhnsd.init.SUSE |  114 +
 client/rhel/rhnsd/rhnsd.spec  |   15 -
 2 files changed, 127 insertions(+), 2 deletions(-)
 create mode 100644 client/rhel/rhnsd/rhnsd.init.SUSE

diff --git a/client/rhel/rhnsd/rhnsd.init.SUSE b/client/rhel/rhnsd/rhnsd.init.SUSE
new file mode 100644
index 000..e2faf8e
--- /dev/null
+++ b/client/rhel/rhnsd/rhnsd.init.SUSE
@@ -0,0 +1,114 @@
+#!/bin/sh
+#
+# rhnsd:	Starts the Red Hat Network Daemon
+#
+# chkconfig: 345 97 03
+# description:  This is a daemon which handles the task of connecting \
+#		periodically to the Red Hat Network servers to \
+#		check for updates, notifications and perform system \
+#		monitoring tasks according to the service level that \
+#		this server is subscribed for
+#
+# processname: rhnsd
+# pidfile: /var/run/rhnsd.pid
+#
+
+### BEGIN INIT INFO
+# 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-Stop: 0 1 6
+# Short-Description: Starts the Red Hat Network Daemon
+# Description: This is a daemon which handles the task of connecting
+#   periodically to the Red Hat Network servers to
+#   check for updates, notifications and perform system
+#   monitoring tasks according to the service level that
+#   this server is subscribed for.
+### END INIT INFO
+
+
+# interval in minutes to connect to Red Hat Network. The minimum allowed
+# value is currently 1 hour; by default rhnsd will connect every four hours.
+# This should be more than suitable for the vast majority of systems.  You
+# may adjust the interval by editing the file /etc/sysconfig/rhn/rhnsd.
+
+RHNSD=/usr/sbin/rhnsd
+RHNSD_PIDFILE=/var/run/rhnsd.pid
+
+# Sanity checks.
+[ -x $RHNSD ] || exit 6
+RHN_UP2DATE_FILE=/etc/sysconfig/rhn/up2date
+[ -f $RHN_UP2DATE_FILE ] || exit 6
+if [ -r $RHN_UP2DATE_FILE ]; then
+RHN_SYSTEMID_FILE=`awk -F '=[[:space:]]*' '/^[[:space:]]*systemIdPath[[:space:]]*=/ {print $2}' $RHN_UP2DATE_FILE`
+[ -f $RHN_SYSTEMID_FILE ] || exit 6
+elif [ $1 != status ];  then
+echo Insufficient privilege. Cannot open file $RHN_UP2DATE_FILE for reading.
+exit 4
+fi
+
+# Source function library.
+. /etc/rc.status
+
+# Shell functions sourced from /etc/rc.status:
+#  rc_check check and set local and overall rc status
+#  rc_statuscheck and set local and overall rc status
+#  rc_status -v ditto but be verbose in local rc status
+#  rc_status -v -r  ditto and clear the local rc status
+#  rc_failedset local and overall rc status to failed
+#  rc_reset clear local rc status (overall remains)
+#  rc_exit  exit appropriate to overall rc status
+
+# First reset status of this service
+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
+}
+
+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.
+case $1 in
+start)
+	start
+	;;
+stop)
+	stop
+	;;
+status)
+echo -n Checking for service rhnsd: 
+checkproc -p $RHNSD_PIDFILE $RHNSD
+	rc_status -v
+;;
+restart|force-reload)
+	stop
+	start
+	;;
+condrestart|try-restart)
+	if [ -f /var/lock/subsys/rhnsd ]; then
+	stop
+	start
+	fi
+	;;
+reload)
+echo -n $Reloading Red Hat Network Daemon: 
+killproc -p $RHNSD_PIDFILE -HUP $RHNSD
+rc_status -v
+echo
+;;
+*)
+	echo $Usage: $0 {start|stop|status|restart|force-reload|condrestart|try-restart|reload}
+exit 2
+esac
+rc_exit
diff --git a/client/rhel/rhnsd/rhnsd.spec b/client/rhel/rhnsd/rhnsd.spec
index bf99b51..ea566e4 100644
--- a/client/rhel/rhnsd/rhnsd.spec
+++ b/client/rhel/rhnsd/rhnsd.spec
@@ -11,11 +11,17 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: gettext
 
 Requires: 

[Spacewalk-devel] [PATCH] build osad on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch to build and run osad on openSUSE.

0006-build-osad-on-SUSE.patch:
- specfile work
- add init script for SUSE
- osad.py missed and import of the config module

-- 
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: Markus Rex, HRB 16746 (AG Nürnberg)
From 17423372daefefabeb43a68b921dd665196adc86 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 15:17:06 +0200
Subject: [PATCH 06/17] build osad on SUSE

- modify specfile
- add init script for SUSE
---
 client/tools/osad/osad.spec  |   57 +++--
 client/tools/osad/prog.init.SUSE |   75 ++
 client/tools/osad/src/osad.py|1 +
 3 files changed, 129 insertions(+), 4 deletions(-)
 create mode 100755 client/tools/osad/prog.init.SUSE

diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index 80cb6ab..285d30e 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -3,6 +3,14 @@
 %define client_caps_dir /etc/sysconfig/rhn/clientCaps.d
 %{!?pythongen:%define pythongen %(%{__python} -c import sys ; print sys.version[:3])}
 
+%if 0%{?suse_version}
+%define apache_group www
+%define include_selinux_package 0
+%else
+%define apache_group apache
+%define include_selinux_package 1
+%endif
+
 Name: osad
 Summary: Open Source Architecture Daemon
 Group:   System Environment/Daemons
@@ -17,22 +25,32 @@ BuildRequires: python-devel
 Requires: python
 Requires: rhnlib = 2.5.38
 Requires: jabberpy
-%if 0%{?rhel} = 5
+%if 0%{?rhel}  0%{?rhel} = 5
 Requires: python-hashlib
 %endif
 # This should have been required by rhnlib
+%if 0%{?suse_version} = 1140
+Requires: python-xml
+%else
 Requires: PyXML
+%endif
 %if %{pythongen} == 1.5
 Requires: python-iconv
 %endif
 Conflicts: osa-dispatcher  %{version}-%{release}
 Conflicts: osa-dispatcher  %{version}-%{release}
+%if !0%{?suse_version}
 Requires(post): chkconfig
 Requires(preun): chkconfig
 # This is for /sbin/service
 Requires(preun): initscripts
+%else
+Requires(post): aaa_base
+Requires(preun): aaa_base
+BuildRequires: sysconfig syslog
+%endif
 
-%description 
+%description
 OSAD agent receives commands over jabber protocol from Spacewalk Server and
 commands are instantly executed.
 
@@ -47,16 +65,24 @@ Requires: jabberpy
 Requires: lsof
 Conflicts: %{name}  %{version}-%{release}
 Conflicts: %{name}  %{version}-%{release}
+%if !0%{?suse_version}
 Requires(post): chkconfig
 Requires(preun): chkconfig
 # This is for /sbin/service
 Requires(preun): initscripts
+%else
+Requires(post): aaa_base
+Requires(preun): aaa_base
+Requires: logrotate
+BuildRequires: sysconfig
+%endif
 
 %description -n osa-dispatcher
 OSA dispatcher is supposed to run on the Spacewalk server. It gets information
 from the Spacewalk server that some command needs to be execute on the client;
 that message is transported via jabber protocol to OSAD agent on the clients.
 
+%if 0%{?include_selinux_package}
 %package -n osa-dispatcher-selinux
 %define selinux_variants mls strict targeted
 %define selinux_policyver %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp 2 /dev/null)
@@ -83,13 +109,18 @@ Requires: osa-dispatcher
 
 %description -n osa-dispatcher-selinux
 SELinux policy module supporting osa-dispatcher.
+%endif
 
 %prep
 %setup -q
+%if 0%{?suse_version}
+cp prog.init.SUSE prog.init
+%endif
 
 %build
 make -f Makefile.osad all
 
+%if 0%{?include_selinux_package}
 %{__perl} -i -pe 'BEGIN { $VER = join ., grep /^\d+$/, split /\./, %{version}.%{release}; } s!\@\@VERSION\@\@!$VER!g;' osa-dispatcher-selinux/%{modulename}.te
 for selinuxvariant in %{selinux_variants}
 do
@@ -97,12 +128,14 @@ do
 mv osa-dispatcher-selinux/%{modulename}.pp osa-dispatcher-selinux/%{modulename}.pp.${selinuxvariant}
 make -C osa-dispatcher-selinux NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean
 done
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{rhnroot}
-make -f Makefile.osad install PREFIX=$RPM_BUILD_ROOT ROOT=%{rhnroot}
+make -f Makefile.osad install PREFIX=$RPM_BUILD_ROOT ROOT=%{rhnroot} INITDIR=%{_initrddir}
 
+%if 0%{?include_selinux_package}
 for selinuxvariant in %{selinux_variants}
   do
 install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
@@ -121,6 +154,7 @@ install -p -m 644 osa-dispatcher-selinux/%{modulename}.if \
 # Install osa-dispatcher-selinux-enable which will be called in %post
 install -d %{buildroot}%{_sbindir}
 install -p -m 755 osa-dispatcher-selinux/osa-dispatcher-selinux-enable %{buildroot}%{_sbindir}/osa-dispatcher-selinux-enable
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -147,6 

[Spacewalk-devel] [PATCH] build rhncfg on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch for rhncfg.

0007-build-rhncfg-on-SUSE.patch:
- only some specfile modifications

-- 
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: Markus Rex, HRB 16746 (AG Nürnberg)
From e121739043aef3810620b7a5a3d0c8d4206e7bea Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 15:53:50 +0200
Subject: [PATCH 07/17] build rhncfg on SUSE

- modify specfile
---
 client/tools/rhncfg/rhncfg.spec |   12 +++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index cd92e13..4965430 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -21,8 +21,10 @@ Requires: rhnlib = 2.5.32
 Requires: up2date
 %else
 Requires: rhn-client-tools
+%if 0%{?rhel}
 Requires: libselinux-python
 %endif
+%endif
 
 %description 
 The base libraries and functions needed by all rhncfg-* packages.
@@ -73,12 +75,17 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
+%dir %{rhnroot}
+%dir %{_sharedstatedir}
+%dir %{_sharedstatedir}/rhncfg
+%dir %{_sharedstatedir}/rhncfg/backups
 %{rhnroot}/config_common
 %{_sharedstatedir}/rhncfg/backups
 %doc LICENSE PYTHON-LICENSES.txt
 
 %files client
 %defattr(-,root,root,-)
+%dir %{rhnconf}
 %{rhnroot}/config_client
 %{_bindir}/rhncfg-client
 %attr(644,root,root) %config(noreplace) %{rhnconf}/rhncfg-client.conf
@@ -86,6 +93,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files management
 %defattr(-,root,root,-)
+%dir %{rhnconf}
 %{rhnroot}/config_management
 %{_bindir}/rhncfg-manager
 %attr(644,root,root) %config(noreplace) %{rhnconf}/rhncfg-manager.conf
@@ -93,7 +101,9 @@ rm -rf $RPM_BUILD_ROOT
 
 %files actions
 %defattr(-,root,root,-)
-%{rhnroot}/actions/*
+%dir %{rhnconf}
+%dir %{client_caps_dir}
+%{rhnroot}/actions
 %{_bindir}/rhn-actions-control
 %config(noreplace) %{client_caps_dir}/*
 %{_mandir}/man8/rhn-actions-control.8*
-- 
1.7.3.4

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

[Spacewalk-devel] [PATCH] build rhn-custom-info on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch to build rhn-custom-info on openSUSE.

0008-build-rhn-custom-info-on-SUSE.patch:
- only some specfile modifications

-- 
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: Markus Rex, HRB 16746 (AG Nürnberg)
From f6aab93e04de6dbcb18bc27b2b75cc1f8b0cb1a7 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 16:13:39 +0200
Subject: [PATCH 08/17] build rhn-custom-info on SUSE

- modify the specfile
---
 client/tools/rhncustominfo/rhn-custom-info.spec |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/client/tools/rhncustominfo/rhn-custom-info.spec b/client/tools/rhncustominfo/rhn-custom-info.spec
index e6adbf5..f1638e5 100644
--- a/client/tools/rhncustominfo/rhn-custom-info.spec
+++ b/client/tools/rhncustominfo/rhn-custom-info.spec
@@ -21,8 +21,12 @@ Requires: rhnlib
 %if 0%{?rhel} = 5 || 0%{?fedora} = 1
 Requires: yum-rhn-plugin
 %else
+%if 0%{?suse_version}
+Requires: zypp-plugin-spacewalk
+%else
 Requires: up2date
 %endif
+%endif
 
 %description 
 Allows for the setting and listing of custom key/value pairs for 
@@ -46,6 +50,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
+%dir %{_datadir}/rhn
 %{_bindir}/rhn-custom-info
 %dir %{_datadir}/rhn/custominfo
 %{_datadir}/rhn/custominfo/rhn-custom-info.py*
-- 
1.7.3.4

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

[Spacewalk-devel] [PATCH] build rhnpush on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch to build rhnpush on openSUSE.

0009-build-rhnpush-on-SUSE.patch:
- only some specfile modifications

-- 
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: Markus Rex, HRB 16746 (AG Nürnberg)
From ae5b4c241c5937c0560f7cca3b190e4b1b32e00f Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 16:26:21 +0200
Subject: [PATCH 09/17] build rhnpush on SUSE

- modify the specfile
---
 client/tools/rhnpush/rhnpush.spec |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/client/tools/rhnpush/rhnpush.spec b/client/tools/rhnpush/rhnpush.spec
index 43f0008..b81784e 100644
--- a/client/tools/rhnpush/rhnpush.spec
+++ b/client/tools/rhnpush/rhnpush.spec
@@ -19,6 +19,7 @@ Requires:  up2date
 Requires:  rhn-client-tools
 %endif
 BuildRequires: docbook-utils, gettext
+BuildRequires: python-devel
 
 Summary: Package uploader for the Red Hat Network Satellite Server
 
@@ -46,6 +47,8 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root)
+%dir %{rhnroot}
+%dir %{_sysconfdir}/sysconfig/rhn
 %dir %{rhnroot}/rhnpush
 %{rhnroot}/rhnpush/*
 %attr(755,root,root) %{_bindir}/rhnpush
-- 
1.7.3.4

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

[Spacewalk-devel] [PATCH] build rhn-virtualization on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch to build rhn-virtualization on openSUSE.

0010-build-rhn-virtualization-on-SUSE.patch:
- modify the specfile
- add SUSE init script

-- 
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: Markus Rex, HRB 16746 (AG Nürnberg)
From 2546d27a7edbf2c4ae2235e2c64220db60bdb95a Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 17:09:19 +0200
Subject: [PATCH 10/17] build rhn-virtualization on SUSE

- modify the specfile
- add SUSE init script
---
 .../rhn-virtualization/rhn-virtualization.spec |   28 +-
 .../scripts/rhn-virtualization-host.SUSE   |  113 
 2 files changed, 138 insertions(+), 3 deletions(-)
 create mode 100755 client/tools/rhn-virtualization/scripts/rhn-virtualization-host.SUSE

diff --git a/client/tools/rhn-virtualization/rhn-virtualization.spec b/client/tools/rhn-virtualization/rhn-virtualization.spec
index e9b7bf6..fab0e8b 100644
--- a/client/tools/rhn-virtualization/rhn-virtualization.spec
+++ b/client/tools/rhn-virtualization/rhn-virtualization.spec
@@ -15,6 +15,9 @@ Release:1%{?dist}
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:  noarch
 BuildRequires:  python
+%if 0%{?suse_version}
+BuildRequires: sysconfig syslog
+%endif
 
 %description
 rhn-virtualization provides various RHN/Spacewalk actions for manipulation 
@@ -24,7 +27,9 @@ virtual machine guest images.
 Summary: Files needed by rhn-virtualization-host
 Group: System Environment/Base
 Requires: rhn-client-tools
+%if !0%{?suse_version}
 Requires: chkconfig
+%endif
 
 %description common
 This package contains files that are needed by the rhn-virtualization-host
@@ -35,7 +40,11 @@ Summary: RHN/Spacewalk Virtualization support specific to the Host system
 Group: System Environment/Base
 Requires: libvirt-python
 Requires: rhn-virtualization-common = %{version}-%{release}
+%if 0%{?suse_version}
+Requires: cron
+%else
 Requires: /usr/sbin/crond
+%endif
 %if 0%{?rhel}  0%{?rhel}  6
 # in RHEL5 we need libvirt, but in RHEV@RHEL5 there should not be libvirt
 # as there is vdsm and bunch of other packages, but we have no clue how to
@@ -51,7 +60,9 @@ that is specific to the Host system (a.k.a. Dom0).
 
 %prep
 %setup -q
-
+%if 0%{?suse_version}
+cp scripts/rhn-virtualization-host.SUSE scripts/rhn-virtualization-host
+%endif
 
 %build
 make -f Makefile.rhn-virtualization
@@ -59,25 +70,35 @@ make -f Makefile.rhn-virtualization
 
 %install
 rm -rf $RPM_BUILD_ROOT
-make -f Makefile.rhn-virtualization DESTDIR=$RPM_BUILD_ROOT install
+make -f Makefile.rhn-virtualization DESTDIR=$RPM_BUILD_ROOT PKGDIR0=%{_initrddir} install
+
 
- 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 
 %post host
 /sbin/chkconfig --add rhn-virtualization-host
+%if 0%{?suse_version}
+/sbin/service cron try-restart ||:
+%else
 /sbin/service crond condrestart
+%endif
 
 %preun host
 /sbin/chkconfig --del rhn-virtualization-host
 
 %postun host
+%if 0%{?suse_version}
+/sbin/service cron try-restart ||:
+%else
 /sbin/service crond condrestart
+%endif
 
 %files common
 %defattr(-,root,root,-)
+%dir %{rhn_dir}
+%dir %{rhn_dir}/actions
 %dir %{rhn_dir}/virtualization
 %{rhn_dir}/virtualization/__init__.py
 %{rhn_dir}/virtualization/__init__.pyc
@@ -101,6 +122,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files host
 %defattr(-,root,root,-)
+%dir %{rhn_conf_dir}
 %dir %{rhn_conf_dir}/virt
 %dir %{rhn_conf_dir}/virt/auto
 %{_initrddir}/rhn-virtualization-host
diff --git a/client/tools/rhn-virtualization/scripts/rhn-virtualization-host.SUSE b/client/tools/rhn-virtualization/scripts/rhn-virtualization-host.SUSE
new file mode 100755
index 000..da66d86
--- /dev/null
+++ b/client/tools/rhn-virtualization/scripts/rhn-virtualization-host.SUSE
@@ -0,0 +1,113 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides:   rhn-virtualization-host
+# Required-Start: $network $syslog $remote_fs
+# Required-Stop:  $network $syslog $remote_fs
+# Default-Start:  3 5
+# Default-Stop: 0 1 6
+# Short-Description: Starts up xen domains when the host boots.
+# Description:Starts up xen domains when the host boots.
+### END INIT INFO
+
+# chkconfig: 2345 99 99
+# description: Starts up xen domains when the host boots.
+
+. /etc/rc.status
+
+auto_dir=/etc/sysconfig/rhn/virt/auto
+py_path=/usr/share/rhn:/usr/share/rhn/virtualization
+script_path=/usr/share/rhn/virtualization
+get_config_value=PYTHONPATH=$py_path python $script_path/get_config_value.py
+get_uuid=$get_config_value uuid
+get_name=$get_config_value name
+init_action=PYTHONPATH=$py_path python $script_path/init_action.py
+start_action=$init_action start
+stop_action=$init_action shutdown
+
+if [ -d $auto_dir ]; 

[Spacewalk-devel] [PATCH] build spacewalk-koan on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch to build spacewalk-koan on openSUSE.

0011-build-spacewalk-koan-on-SUSE.patch:
- modify the specfile
- require virtualization packages
  It seems, that code of spacewalk-koan import modules from 
  rhn-virtualization. So I added these requires to the specfile.

  Is there a special reason why it is not there, or simply forgot to add this
  requirement?

-- 
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: Markus Rex, HRB 16746 (AG Nürnberg)
From 30054d1b13c57c4693f565d99437c2466838e635 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Tue, 5 Apr 2011 11:00:39 +0200
Subject: [PATCH 11/17] build spacewalk-koan on SUSE

- modify the specfile
- require virtualization packages
---
 client/tools/spacewalk-koan/spacewalk-koan.spec |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/client/tools/spacewalk-koan/spacewalk-koan.spec b/client/tools/spacewalk-koan/spacewalk-koan.spec
index d184849..0124dec 100644
--- a/client/tools/spacewalk-koan/spacewalk-koan.spec
+++ b/client/tools/spacewalk-koan/spacewalk-koan.spec
@@ -12,6 +12,8 @@ BuildArch:  noarch
 BuildRequires:  python
 Requires:   python = 1.5
 Requires:   koan = 1.4.3
+Requires:   rhn-virtualization-common
+Requires:   rhn-virtualization-host
 
 Conflicts: rhn-kickstart
 Conflicts: rhn-kickstart-common
@@ -47,6 +49,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_sbindir}/*
 %{_datadir}/rhn/spacewalkkoan/
 %{_datadir}/rhn/actions/
+%dir %{_datadir}/rhn
+%dir %{_sysconfdir}/sysconfig/rhn
+%dir %{_sysconfdir}/sysconfig/rhn/clientCaps.d
 
 %changelog
 * Wed Feb 02 2011 Tomas Lestach tlest...@redhat.com 0.2.16-1
-- 
1.7.3.4

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

[Spacewalk-devel] [PATCH] build spacewalk-remote-utils on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch to build spacewalk-remote-utils on openSUSE.

0012-build-spacewalk-remote-utils-on-SUSE.patch
- adding only one little dir to the filelist of the specfile

-- 
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: Markus Rex, HRB 16746 (AG Nürnberg)
From be0b18e181d32a2d20a586f1f07304d73ee3ad01 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Tue, 5 Apr 2011 11:00:52 +0200
Subject: [PATCH 12/17] build spacewalk-remote-utils on SUSE

- modify the specfile
---
 .../spacewalk-remote-utils.spec|1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec b/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec
index 1057a89..451038b 100644
--- a/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec
+++ b/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec
@@ -45,6 +45,7 @@ docbook2man ./spacewalk-create-channel/doc/spacewalk-create-channel.sgml -o ./sp
 
 %files
 %defattr(-,root,root,-)
+%dir %{_datadir}/rhn
 %{_bindir}/spacewalk-create-channel
 #%{python_sitelib}/spacecmd/
 %{_datadir}/rhn/channel-data/
-- 
1.7.3.4

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

[Spacewalk-devel] [PATCH] adding support zypper in bootstrap script and allow multiple GPG keys

2011-04-08 Thread Michael Calmer
Hi,

here is a patch for the server side. This patch add support for zypper as 
installer to the bootstrap script. 

Additionally it enhances the ORG_GPG_KEY variable to be a comma seperated list 
like the activation keys.

0013-support-zypper-in-bootstrap-script-and-allow-multipl.patch
- add zypper as valid installer in the bootstrap script
- allow to install multiple GPG keys.
  Use comma seperated list in ORG_GPG_KEY
- force installing ORG_CA_CERT if rpm is used

-- 
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: Markus Rex, HRB 16746 (AG Nürnberg)
From 1e8596981b5101f7824cfc257f3a611ca96de676 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Tue, 5 Apr 2011 13:25:26 +0200
Subject: [PATCH 13/17] support zypper in bootstrap script and allow multiple GPG keys

- add zypper as valid installer in the bootstrap script
- allow to install multiple GPG keys.
  Use comma seperated list in ORG_GPG_KEY
- force installing ORG_CA_CERT if rpm is used
---
 spacewalk/certs-tools/rhn_bootstrap_strings.py |  116 +---
 1 files changed, 82 insertions(+), 34 deletions(-)

diff --git a/spacewalk/certs-tools/rhn_bootstrap_strings.py b/spacewalk/certs-tools/rhn_bootstrap_strings.py
index af0f4fd..25f71a1 100644
--- a/spacewalk/certs-tools/rhn_bootstrap_strings.py
+++ b/spacewalk/certs-tools/rhn_bootstrap_strings.py
@@ -78,8 +78,8 @@ echo   - edit the values of the VARIABLES below (in this script) as
 echo appropriate:
 echo - ACTIVATION_KEYS needs to reflect the activation key(s) value(s)
 echo   from the website. XKEY or XKEY,YKEY
-echo - ORG_GPG_KEY needs to be set to the name of the corporate public
-echo   GPG key filename (residing in /var/www/html/pub) if appropriate.
+echo - ORG_GPG_KEY needs to be set to the name(s) of the corporate public
+echo   GPG key filename(s) (residing in /var/www/html/pub) if appropriate. XKEY or XKEY,YKEY
 echo
 echo Verify that the script variable settings are correct:
 echo - CLIENT_OVERRIDES should be only set differently if a customized
@@ -131,7 +131,7 @@ PROFILENAME=   # Empty by default to let it be set automatically.
 
 # an idea from Erich Morisse (of Red Hat).
 # use either wget *or* curl
-# Also check to see if the version on the 
+# Also check to see if the version on the
 # machine supports the insecure mode and format
 # command accordingly.
 
@@ -143,7 +143,7 @@ if [ -x /usr/bin/wget ] ; then
 else
 FETCH=/usr/bin/wget -q -r -nd
 fi
-
+
 else
 if [ -x /usr/bin/curl ] ; then
 output=`LANG=en_US /usr/bin/curl -k 21`
@@ -161,9 +161,11 @@ if [ $USING_SSL -eq 0 ] ; then
 HTTPS_PUB_DIRECTORY=${HTTP_PUB_DIRECTORY}
 fi
 
-YUM=up2date
-if [ -x /usr/bin/yum ] ; then
-YUM=yum
+INSTALLER=up2date
+if [ -x /usr/bin/zypper ] ; then
+INSTALLER=zypper
+elif [ -x /usr/bin/yum ] ; then
+INSTALLER=yum
 fi
 
 
@@ -231,19 +233,21 @@ echo   . up2date config file
 
 def getGPGKeyImportSh():
 return \
-if [ ! -z $ORG_GPG_KEY ] ; then 
+if [ ! -z $ORG_GPG_KEY ] ; then
 echo
 echo * importing organizational GPG key
-rm -f ${ORG_GPG_KEY}
-$FETCH ${HTTPS_PUB_DIRECTORY}/${ORG_GPG_KEY}
-# get the major version of up2date
-# this will also work for RHEL 5 and systems where no up2date is installed
-res=$(LC_ALL=C rpm -q --queryformat '%{version}' up2date | sed -e 's/\..*//g')
-if [ x$res == x2 ] ; then
-gpg $(up2date --gpg-flags) --import $ORG_GPG_KEY
-else
-rpm --import $ORG_GPG_KEY
-fi
+for GPG_KEY in $(echo $ORG_GPG_KEY | tr ,  ); do
+	rm -f ${GPG_KEY}
+	$FETCH ${HTTPS_PUB_DIRECTORY}/${GPG_KEY}
+	# get the major version of up2date
+	# this will also work for RHEL 5 and systems where no up2date is installed
+	res=$(LC_ALL=C rpm -q --queryformat '%{version}' up2date | sed -e 's/\..*//g')
+	if [ x$res == x2 ] ; then
+	gpg $(up2date --gpg-flags) --import $GPG_KEY
+	else
+	rpm --import $GPG_KEY
+	fi
+done
 fi
 
 
@@ -255,11 +259,23 @@ echo
 echo * attempting to install corporate public CA cert
 if [ $USING_SSL -eq 1 ] ; then
 if [ $ORG_CA_CERT_IS_RPM_YN -eq 1 ] ; then
-rpm -Uvh ${HTTP_PUB_DIRECTORY}/${ORG_CA_CERT}
+rpm -Uvh --force --replacefiles --replacepkgs ${HTTP_PUB_DIRECTORY}/${ORG_CA_CERT}
 else
 rm -f ${ORG_CA_CERT}
 $FETCH ${HTTP_PUB_DIRECTORY}/${ORG_CA_CERT}
 mv ${ORG_CA_CERT} /usr/share/rhn/
+
+fi
+if [ $INSTALLER == zypper ] ; then
+	if [  $ORG_CA_CERT_IS_RPM_YN -eq 1 ] ; then
+	  # get name from config
+	  ORG_CA_CERT=$(basename $(sed -n 's/^sslCACert *= *//p' /etc/sysconfig/rhn/up2date))
+	fi
+	test -e /etc/ssl/certs/${ORG_CA_CERT}.pem || 

[Spacewalk-devel] [PATCH] build rhnmd on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is a patch to build rhnmd on openSUSE.

0014-build-rhnmd-on-SUSE.patch
- modify the specfile
- add init script for openSUSE

For SUSE I have removed the ssh key generation from the %post section.
I added the generation into the SUSE init script. 
The reason for this is, that if you do it in %post and use this RPM in an 
appliance, you have the same ssh key on all copies of your appliance.

Maybe you are interrested to do this also for RedHat / Fedora. 

-- 
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: Markus Rex, HRB 16746 (AG Nürnberg)
From 4122bb4df08db847813f13fc53f37ef76568f749 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Wed, 6 Apr 2011 12:24:08 +0200
Subject: [PATCH 14/17] build rhnmd on SUSE

- modify the specfile
- add init script for SUSE
---
 monitoring/rhnmd/rhnmd.init.SUSE |  107 ++
 monitoring/rhnmd/rhnmd.spec  |   21 +++-
 2 files changed, 127 insertions(+), 1 deletions(-)
 create mode 100644 monitoring/rhnmd/rhnmd.init.SUSE

diff --git a/monitoring/rhnmd/rhnmd.init.SUSE b/monitoring/rhnmd/rhnmd.init.SUSE
new file mode 100644
index 000..a77edff
--- /dev/null
+++ b/monitoring/rhnmd/rhnmd.init.SUSE
@@ -0,0 +1,107 @@
+#!/bin/bash
+#
+# Init file for rhnmd daemon
+#
+# chkconfig: 2345 99 1
+# description: rhnmd server daemon
+#
+# processname: rhnmd
+
+### BEGIN INIT INFO
+# Provides: rhnmd
+# Required-Start: $local_fs $network $remote_fs
+# Required-Stop: $local_fs $network $remote_fs
+# Default-Start: 2 3 5
+# Default-Stop: 0 1 6
+# Short-Description: rhnmd server daemon
+# Description: Provides wrapper around sshd
+#   so NOCpulse monitoring can connect to your machine
+#   and run probes, which requires local account.
+### END INIT INFO
+
+# source function library
+. /etc/rc.status
+
+prog=rhnmd
+
+# Some functions to make the below more readable
+SU=/bin/su -s /bin/bash - nocpulse -c
+SSHD=/usr/sbin/rhnmd
+SSHD_PIDFILE=/var/run/rhnmd.pid
+
+do_restart_sanity_check()
+{
+	$SU $SSHD -t -f /etc/nocpulse/rhnmd_config
+	RETVAL=$?
+	if [ ! $RETVAL = 0 ]; then
+		rc_failed
+		echo Configuration file or keys are invalid
+	fi
+}
+
+start()
+{
+	echo -n $Starting $prog:
+	IDENTITY=/var/lib/nocpulse/.ssh/nocpulse-identity
+	if [ ! -f $IDENTITY ]
+	then
+		/bin/su -s /bin/bash -c /usr/bin/ssh-keygen -q -t dsa -N '' -f $IDENTITY - nocpulse
+		if [ ! -e /var/lib/nocpulse/.bashrc ]; then
+			echo 'LANG=C'  /var/lib/nocpulse/.bashrc
+		fi
+	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
+}
+
+reload()
+{
+	echo -n $Reloading $prog:
+	killproc -p $SSHD_PIDFILE -HUP $SSHD
+	rc_status -v
+}
+
+case $1 in
+	start)
+		start
+		;;
+	stop)
+		stop
+		;;
+	restart)
+		stop
+		start
+		;;
+	reload)
+		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
+		;;
+	status)
+	echo -n Checking for service rhnmd: 
+		checkproc -p $SSHD_PIDFILE $SSHD
+		rc_status -v
+		;;
+	*)
+		echo $Usage: $0 {start|stop|restart|reload|condrestart|status}
+esac
+rc_exit
diff --git a/monitoring/rhnmd/rhnmd.spec b/monitoring/rhnmd/rhnmd.spec
index 6779bb5..66fcc1f 100644
--- a/monitoring/rhnmd/rhnmd.spec
+++ b/monitoring/rhnmd/rhnmd.spec
@@ -14,7 +14,12 @@ License:GPLv2
 BuildArch:  noarch
 Group:  System Environment/Daemons
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires:   openssh-server openssh
+Requires:   openssh
+%if 0%{?suse_version}
+BuildRequires:  openssh sysconfig
+%else
+Requires:   openssh-server
+%endif
 BuildRequires:  pam-devel
 Obsoletes:  rhnmd.i386  5.3.0-5
 Obsoletes:  rhnmd.x86_64  5.3.0-5
@@ -42,7 +47,11 @@ mkdir -p $RPM_BUILD_ROOT%{_var}/lib/%{np_name}/.ssh
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
 mkdir -p $RPM_BUILD_ROOT%{_libdir}
 ln -sf sshd $RPM_BUILD_ROOT%{_usr}/sbin/rhnmd
+%if 0%{?suse_version}
+install -pm 0755 rhnmd.init.SUSE $RPM_BUILD_ROOT%{_initddir}/rhnmd
+%else
 install -pm 0755 rhnmd-init $RPM_BUILD_ROOT%{_initddir}/rhnmd
+%endif
 install -pm 0644 rhnmd_config $RPM_BUILD_ROOT%{_sysconfdir}/%{np_name}/rhnmd_config
 install -pm 0600 authorized_keys $RPM_BUILD_ROOT%{_var}/lib/%{np_name}/.ssh/authorized_keys
 install -pm 0644 rhnmd-pam_config $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/rhnmd
@@ -50,9 +59,15 @@ install -pm 0644 

[Spacewalk-devel] [PATCH] small fix for spacewalk-backend

2011-04-08 Thread Michael Calmer
Hi,

and now the last one :-)

I found a small issue in spacewalk-backend, where the locale files are 
installed in duplicate buildroot environment.

In backend/po/Makefile, localedir is defined as $(PREFIX)/usr/share/locale
and in the install section files are installed to $(PREFIX)/$(localedir) .

-- 
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: Markus Rex, HRB 16746 (AG Nürnberg)
From 20cb8563e6e1359aae1b97109cdb8bb51f418b74 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 8 Apr 2011 10:33:32 +0200
Subject: [PATCH 15/17] remove duplicate PREFIX for locale installation

---
 backend/po/Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/backend/po/Makefile b/backend/po/Makefile
index 728e908..f5c3c82 100644
--- a/backend/po/Makefile
+++ b/backend/po/Makefile
@@ -4,7 +4,7 @@
 
 TOP	= ..
 SUBDIR	= locale
-localedir = $(PREFIX)/usr/share/locale
+localedir = /usr/share/locale
 
 include $(TOP)/Makefile.defs
 
-- 
1.7.3.4

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

Re: [Spacewalk-devel] [PATCH] updateinfo to Errata import in spacewalk-repo-sync

2011-04-08 Thread Jan Pazdziora
On Wed, Mar 23, 2011 at 03:25:43PM +0100, Michael Calmer wrote:
 
 Here is a new patchset. I had to do some more changes. To not loose the 
 overview I have combined them into 4 patches.
 
 0001: The database changes
 0002: changes in the python code; mainly reposync and yum repo_plugin
 0003: changes in java web pages
 0004: changes in perl web pages
 
 I hope I included everything what was mentioned in this thread.
 I also did a short test with the nightly build (2 days ago) with a fedora 14 
 repository and a openSUSE 11.4 repository.

Michael,

I've now applied your patches to Spacewalk master. Packages for the
nightly repo are being built while I'm writing this so people will
have chance to see the feature in Spacewalk nightly later today, and
we will have chance to flesh out any issues before Spacewalk 1.4 is
out.

Thank you for your contribution and I'm sorry that it took me so long
to get to your post.

Yours,

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat

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


Re: [Spacewalk-devel] [PATCH] build rhn-client-tools on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

Am Freitag, 8. April 2011, 14:49:30 schrieb Michael Calmer:
 Hi,
 
 
 0002-enhance-getOSVersionAndRelease-to-find-SUSE-distribu.patch:
 Add code to make _getOSVerionAndRelease work on SUSE

This patch has a little typo. I have attached a fixed version.
Sorry :-)

-- 
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: Markus Rex, HRB 16746 (AG Nürnberg)
From 4ea53dfc537e92fd870cd414fc901edb83f7d288 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 11:12:04 +0200
Subject: [PATCH 02/17] enhance getOSVersionAndRelease to find SUSE distributions

---
 .../src/up2date_client/up2dateUtils.py |   16 +++-
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/client/rhel/rhn-client-tools/src/up2date_client/up2dateUtils.py b/client/rhel/rhn-client-tools/src/up2date_client/up2dateUtils.py
index fc33ad1..f7d064f 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/up2dateUtils.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/up2dateUtils.py
@@ -32,11 +32,17 @@ else:
 osVersionRelease = (h['name'], h['version'], h['release'])
 return osVersionRelease
 else:
-raise up2dateErrors.RpmError(
-Could not determine what version of Red Hat Linux you \
-are running.\nIf you get this error, try running \n\n\
-\t\trpm --rebuilddb\n\n)
-
+for h in ts.dbMatch('Providename', distribution-release):
+osVersionRelease = (h['name'], h['version'], h['release'])
+# zypper requires a exclusive lock on the rpmdb. So we need
+# to close it here.
+ts.ts.closeDB()
+return osVersionRelease
+else:
+raise up2dateErrors.RpmError(
+Could not determine what version of Red Hat Linux you \
+are running.\nIf you get this error, try running \n\n\
+\t\trpm --rebuilddb\n\n)
 
 def getVersion():
 '''
-- 
1.7.3.4

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