spacewalk/setup/lib/Spacewalk/Setup.pm | 2 +-
spacewalk/setup/share/oracle/upgrade-db.sh | 23 +++++++++++++++++------
2 files changed, 18 insertions(+), 7 deletions(-)
New commits:
commit f5484fc4226bf5d9ffb392af1b7e164c4a4dec7b
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon Jun 1 17:40:02 2009 +0200
pass custom sid to upgrade-db.sh for embedded db upgrade
diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm
b/spacewalk/setup/lib/Spacewalk/Setup.pm
index 4282df2..247ace1 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -740,7 +740,7 @@ EOQ
-err_message => "Could not upgrade database.\n",
-err_code => 15,
-system_opts => ['/sbin/runuser', 'oracle',
'-c',
- SHARED_DIR . '/oracle' .
'/upgrade-db.sh' ]);
+
"ORACLE_CUSTOM_SID=$answers->{'db-sid'} " . SHARED_DIR .
'/oracle/upgrade-db.sh' ]);
system_or_exit(['service', 'oracle', 'restart'], 41,
'Could not restart oracle service');
commit 72af153f608a2d28b3926b1f811d23c846ad266a
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon Jun 1 17:34:55 2009 +0200
update copyright information
diff --git a/spacewalk/setup/share/oracle/upgrade-db.sh
b/spacewalk/setup/share/oracle/upgrade-db.sh
index 39b8abd..f082292 100644
--- a/spacewalk/setup/share/oracle/upgrade-db.sh
+++ b/spacewalk/setup/share/oracle/upgrade-db.sh
@@ -1,10 +1,18 @@
#!/bin/sh
-# Installs/creates the RHN embedded database at mountpoint /rhnsat
+# Upgrades RHN embedded database at mountpoint /rhnsat
#
-# Copyright (c) 2002-2004, Red Hat, Inc.
-# All rights reserved.
+# Copyright (c) 2008 Red Hat, Inc.
#
-# $Id: inst-rhnsat-db.sh,v 1.14 2008-03-17 10:54:36 mmraka Exp $
+# This software is licensed to you under the GNU General Public License,
+# version 2 (GPLv2). There is NO WARRANTY for this software, express or
+# implied, including the implied warranties of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+# along with this software; if not, see
+#
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+#
+# Red Hat trademarks are not licensed under GPLv2. No permission is
+# granted to use or replicate Red Hat trademarks that are incorporated
+# in this software or its documentation.
set -x
commit 62df9de7c034114c73e9cdf6bef8ccd70177df10
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon Jun 1 17:33:31 2009 +0200
support embedded db upgrade with custom sid
diff --git a/spacewalk/setup/share/oracle/upgrade-db.sh
b/spacewalk/setup/share/oracle/upgrade-db.sh
index f9ad115..39b8abd 100644
--- a/spacewalk/setup/share/oracle/upgrade-db.sh
+++ b/spacewalk/setup/share/oracle/upgrade-db.sh
@@ -29,8 +29,11 @@ ORACLE_CONFIG_9I_DIR=$ORACLE_BASE/config/9.2.0
echo "rhnsat:$ORACLE_HOME:Y" >>/etc/oratab
# change env to rhnsat instance
-ORACLE_SID=rhnsat
-export ORACLE_SID
+if [ -z $ORACLE_CUSTOM_SID ]; then
+ export ORACLE_SID=rhnsat
+else
+ export ORACLE_SID=$ORACLE_CUSTOM_SID
+fi
. oraenv