rel-eng/packages/spacewalk-setup | 2
spacewalk/setup/lib/Spacewalk/Setup.pm | 90 ---------------------
spacewalk/setup/share/oracle/install-db.sh | 96 -----------------------
spacewalk/setup/share/oracle/remove-db.sh | 54 ------------
spacewalk/setup/share/oracle/upgrade-db.sh | 121 -----------------------------
spacewalk/setup/spacewalk-setup.spec | 11 --
6 files changed, 5 insertions(+), 369 deletions(-)
New commits:
commit 4c4d0f5705374876e3d5180dcabda9aa19332adf
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Feb 6 09:42:41 2014 +0100
Automatic commit of package [spacewalk-setup] release [2.1.14-1].
diff --git a/rel-eng/packages/spacewalk-setup b/rel-eng/packages/spacewalk-setup
index 20b5986..34ef8b6 100644
--- a/rel-eng/packages/spacewalk-setup
+++ b/rel-eng/packages/spacewalk-setup
@@ -1 +1 @@
-2.1.13-1 spacewalk/setup/
+2.1.14-1 spacewalk/setup/
diff --git a/spacewalk/setup/spacewalk-setup.spec b/spacewalk/setup/spacewalk-setup.spec
index 6bcb109..10db632 100644
--- a/spacewalk/setup/spacewalk-setup.spec
+++ b/spacewalk/setup/spacewalk-setup.spec
@@ -1,7 +1,7 @@
%{!?fedora: %global sbinpath /sbin}%{?fedora: %global sbinpath %{_sbindir}}
Name: spacewalk-setup
-Version: 2.1.13
+Version: 2.1.14
Release: 1%{?dist}
Summary: Initial setup tools for Red Hat Spacewalk
@@ -107,6 +107,9 @@ rm -rf %{buildroot}
%doc LICENSE
%changelog
+* Thu Feb 06 2014 Michael Mraka <michael.mraka(a)redhat.com> 2.1.14-1
+- removed embedded oracle code
+
* Wed Jan 29 2014 Michael Mraka <michael.mraka(a)redhat.com> 2.1.13-1
- fixed typo in library path
- tomcat on RHEL5 and RHEL6 needs more parameters
commit 9be2a49e7aa531fc3ec0a7baca30ad7d6c8b0c17
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Feb 6 09:39:07 2014 +0100
removed embedded oracle code
diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm
b/spacewalk/setup/lib/Spacewalk/Setup.pm
index 32d3e74..5d3a475 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -1283,7 +1283,6 @@ sub oracle_setup_db {
oracle_check_for_users_and_groups($opts);
print loc("* Setting up database.\n");
- oracle_setup_embedded_db($opts, $answers);
oracle_setup_db_connection($opts, $answers);
oracle_test_db_settings($opts, $answers);
write_rhn_conf($answers, 'db-backend', 'db-name', 'db-user',
'db-password');
@@ -1302,95 +1301,6 @@ sub oracle_check_for_users_and_groups {
}
}
-sub oracle_setup_embedded_db {
- my $opts = shift;
- my $answers = shift;
-
- if (not is_embedded_db($opts)) {
- return 0;
- } else {
- $answers->{'db-user'} = 'rhnsat' if not defined
$answers->{'db-user'};
- $answers->{'db-password'} = 'rhnsat' if not defined
$answers->{'db-password'};
- $answers->{'db-name'} = 'rhnsat.world';
- $answers->{'db-host'} = 'localhost';
- $answers->{'db-port'} = 1521;
- }
-
-
- if ($opts->{'upgrade'}) {
- printf loc(<<EOQ, DB_UPGRADE_LOG_FILE);
-** Database: Upgrading the database server to latest Oracle 10g:
-** Database: This is a long process that is logged in:
-** Database: %s
-EOQ
- print_progress(-init_message => "*** Progress: #",
- -log_file_name => DB_UPGRADE_LOG_FILE,
- -log_file_size => DB_UPGRADE_LOG_SIZE,
- -err_message => "Could not upgrade database.\n",
- -err_code => 15,
- -system_opts => ['/sbin/runuser', 'oracle',
'-c',
- SHARED_DIR . '/oracle/upgrade-db.sh' .
- " --user
$answers->{'db-user'}"]);
-
- system_or_exit(['service', 'oracle', 'restart'], 41,
- 'Could not restart oracle service');
-
- return 0;
- }
-
- if ($opts->{"skip-db-install"} || $opts->{"upgrade"}) {
- print loc("** Database: Embedded database installation SKIPPED.\n");
-
- return 0;
- }
-
- if (-d "/rhnsat/data") {
- my $shared_dir = SHARED_DIR;
- print loc(<<EOQ);
-The embedded database appears to be already installed. Either rerun
-this script with the --skip-db-install option, or use the
-'$shared_dir/oracle/remove-db.sh' script to remove the embedded database and try
-again.
-EOQ
-
- exit 13;
- }
-
- if (not $opts->{"skip-db-diskspace-check"}) {
- system_or_exit(['python', SHARED_DIR .
- '/embedded_diskspace_check.py'], 14,
- 'There is not enough space available for the embedded database.');
- }
- else {
- print loc("** Database: Embedded database diskspace check
SKIPPED!\n");
- }
-
- printf loc(<<EOQ, DB_INSTALL_LOG_FILE);
-** Database: Installing the database:
-** Database: This is a long process that is logged in:
-** Database: %s
-EOQ
-
- if (have_selinux()) {
- local *X; open X, '>', DB_INSTALL_LOG_FILE and close X;
- system('/sbin/restorecon', DB_INSTALL_LOG_FILE);
- }
- print_progress(-init_message => "*** Progress: #",
- -log_file_name => DB_INSTALL_LOG_FILE,
- -log_file_size => DB_INSTALL_LOG_SIZE,
- -err_message => "Could not install database.\n",
- -err_code => 15,
- -system_opts => [ SHARED_DIR . "/oracle/install-db.sh",
- "--user", $answers->{'db-user'},
"--password", $answers->{'db-password'}]);
-
- print loc("** Database: Installation complete.\n");
-
- sleep(5); # We need to sleep because sometimes the database doesn't
- # come back up fast enough.
-
- return 1;
-}
-
sub oracle_setup_db_connection {
my $opts = shift;
my $answers = shift;
diff --git a/spacewalk/setup/share/oracle/install-db.sh
b/spacewalk/setup/share/oracle/install-db.sh
deleted file mode 100644
index 4a83eb8..0000000
--- a/spacewalk/setup/share/oracle/install-db.sh
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/bin/sh
-#
-# Installs/creates the RHN embedded database at mountpoint /rhnsat
-#
-#
-#
-# Copyright (c) 2008--2012 Red Hat, Inc.
-#
-# 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
-
-# exit if anything fails
-set -e
-
-DB_NAME="rhnsat"
-DB_USER="rhnsat"
-DB_PASSWORD="rhnsat"
-
-if [ ${#} -gt 0 ]; then
- while [ -n "$1" ] ; do
- case $1 in
- -d | --db | --database )
- shift
- DB_NAME=$1
- ;;
- -u | --user* )
- shift
- DB_USER=$1
- ;;
- -p | --password )
- shift
- DB_PASSWORD=$1
- ;;
- * )
- exit -1
- ;;
- esac
- shift
- done
-fi
-
-# set oracle environment to embedded server
-ORAENV_ASK=NO
-ORACLE_SID=embedded
-export ORAENV_ASK ORACLE_SID
-. oraenv
-
-mkdir -p /rhnsat/data /rhnsat/admin
-chown -RL oracle:dba /rhnsat
-if selinuxenabled && semodule -l | grep '^oracle-rhnsat\b' ; then
- restorecon -rv /rhnsat
- RUNRESTORECON=--run-restorecon
-fi
-
-ORACLE_ADMIN_DIR=/opt/apps/oracle/admin/10.2.0
-export ORACLE_ADMIN_DIR
-
-/sbin/runuser - oracle -c "$ORACLE_ADMIN_DIR/create-db.sh --db $DB_NAME --user
$DB_USER --password $DB_PASSWORD --datadir /rhnsat/data/rhnsat --admindir
/rhnsat/admin/rhnsat --template $ORACLE_ADMIN_DIR/embedded-createdb.tmpl
$RUNRESTORECON"
-
-LISTFILE=$ORACLE_HOME/network/admin/listener.ora
-
-cat > $LISTFILE <<EOF
-LISTENER=
- (DESCRIPTION=
- (ADDRESS_LIST=
- (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
- ))
-SID_LIST_LISTENER=
- (SID_LIST=
- (SID_DESC=
- (GLOBAL_DBNAME=$DB_NAME.world)
- (ORACLE_HOME=$ORACLE_HOME)
- (SID_NAME=$DB_NAME))
- )
-EOF
-
-chown oracle:dba $LISTFILE
-
-# add the service
-chkconfig --add oracle
-
-service oracle restart
-
-set +x
-
diff --git a/spacewalk/setup/share/oracle/remove-db.sh
b/spacewalk/setup/share/oracle/remove-db.sh
deleted file mode 100644
index 1053d70..0000000
--- a/spacewalk/setup/share/oracle/remove-db.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-#
-# simply stop the oracle instance, nuke all the data associated with it,
-# and then remove the daemon
-#
-# WARNING: mere mortals should not use this script!
-#
-# usage: /bin/bash remove-db.sh
-#
-#
-#
-# Copyright (c) 2008 Red Hat, Inc.
-#
-# 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
-
-# shut down the instance; stop the listener
-/sbin/service oracle stop
-
-# wipeout the data directories
-rm -rfv /rhnsat
-find ~oracle/config/ -type f | grep -i rhnsat | xargs rm -rfv
-
-# remove the service
-/sbin/chkconfig --del oracle
-
-# let's get violent! Kill all oracle processes!
-/sbin/runuser - oracle -c 'kill -9 -1'
-sleep 1
-
-# removing any remaining Semaphore Arrays (see ipcs -s)
-ipcs -s | perl -l -a -n -e 'print $F[1] if $F[2] =~ /oracle/ and $F[1] =~ /^[0-9]/
' | xargs -n 1 -r ipcrm -s
-
-# removing any remaining Shared Memory Segments (see ipcs -m)
-ipcs -m | perl -l -a -n -e 'print $F[1] if $F[2] =~ /oracle/ and $F[1] =~
/^[0-9]/' | xargs -n 1 -r ipcrm -m
-
-set +x
-
-echo
-echo "WARNING: you may want to double check that shared memory and semaphore"
-echo " resources are cleared out for oracle via the ipcs and ipcrm"
-echo " commands"
-
diff --git a/spacewalk/setup/share/oracle/upgrade-db.sh
b/spacewalk/setup/share/oracle/upgrade-db.sh
deleted file mode 100644
index 50f4202..0000000
--- a/spacewalk/setup/share/oracle/upgrade-db.sh
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/bin/sh
-# Upgrades RHN embedded database at mountpoint /rhnsat
-#
-# Copyright (c) 2008--2012 Red Hat, Inc.
-#
-# 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
-
-# exit if anything fails
-set -e
-set -o pipefail
-
-DB_NAME="rhnsat"
-DB_USER="rhnsat"
-
-if [ ${#} -gt 0 ]; then
- while [ -n "$1" ] ; do
- case $1 in
- -d | --db | --database )
- shift
- DB_NAME=$1
- ;;
- -u | --user* )
- shift
- DB_USER=$1
- ;;
- * )
- exit -1
- ;;
- esac
- shift
- done
-fi
-
-if [ -r "$(dbhome embedded)/dbs/spfilerhnsat.ora" ]; then
- MAJOR_DB_UPGRADE=0
-else
- MAJOR_DB_UPGRADE=1
-fi
-
-# set oracle environment to embedded server
-ORAENV_ASK=NO
-ORACLE_SID=embedded
-ORACLE_BASE=/opt/apps/oracle
-. oraenv
-
-ORACLE_9I_HOME=$(echo $ORACLE_HOME | sed 's|10\.2\.0/db_1|9.2.0|')
-ORACLE_ADMIN_DIR=$ORACLE_BASE/admin/10.2.0
-ORACLE_ADMIN_9I_DIR=$ORACLE_BASE/admin/9.2.0
-ORACLE_CONFIG_DIR=$ORACLE_BASE/config/10.2.0
-ORACLE_CONFIG_9I_DIR=$ORACLE_BASE/config/9.2.0
-
-# change env to rhnsat instance
-export ORACLE_SID=$DB_NAME
-
-# If the record for satellite database exists, substitute it with new value.
-# Otherwise create a new record.
-if grep -q "^$ORACLE_SID:.*$" /etc/oratab; then
- # We cannot do in-place edit, since we're running under oracle user and
- # do not have write access to /etc
- oratab=$(sed "s;^$ORACLE_SID:.*$;$ORACLE_SID:$ORACLE_HOME:Y;" /etc/oratab)
- echo "$oratab" > /etc/oratab
-else
- echo "$ORACLE_SID:$ORACLE_HOME:Y" >> /etc/oratab
-fi
-
-. oraenv
-
-# modify listener
-LISTENER_ORA=network/admin/listener.ora
-[ -f $ORACLE_HOME/$LISTENER_ORA ] || \
-sed "s|\(ORACLE_HOME=.*\)|(ORACLE_HOME=$ORACLE_HOME)|" \
- $ORACLE_9I_HOME/$LISTENER_ORA >$ORACLE_HOME/$LISTENER_ORA
-
-# for 9i -> 10g upgrades, modify db init files
-if [ $MAJOR_DB_UPGRADE -gt 0 ]; then
- cp -a $ORACLE_CONFIG_9I_DIR/* $ORACLE_CONFIG_DIR/
- UPGRADE_PFILE=$ORACLE_CONFIG_DIR/upgrade-init$ORACLE_SID.ora
- cat $ORACLE_ADMIN_DIR/init-params.ora >$UPGRADE_PFILE
- grep --text -E -f - $ORACLE_CONFIG_9I_DIR/spfile$ORACLE_SID.ora \
- >>$UPGRADE_PFILE <<EOPATTERNS
-audit_file_dest
-background_dump_dest
-control_files
-core_dump_dest
-db_domain
-db_name
-instance_name
-user_dump_dest
-EOPATTERNS
- echo "compatible=10.2.0.4.0" >>$UPGRADE_PFILE
- $ORACLE_ADMIN_DIR/oracle-compute-sga.sh >>$UPGRADE_PFILE
-fi
-
-# upgrade the database
-if [ $MAJOR_DB_UPGRADE -gt 0 ]; then
- UPGRADE_TMPL=$ORACLE_ADMIN_DIR/embedded-upgradedb.tmpl
-else
- UPGRADE_TMPL=$ORACLE_ADMIN_DIR/embedded-upgradedb-10g.tmpl
-fi
-
-# sqlplus ... | cat ... is here to fool selinux, since oracle_sqlplus_t
-m4 -I$ORACLE_ADMIN_DIR \
- --define RHNORA_DBNAME=$ORACLE_SID \
- --define RHNORA_DATA_PATH=/rhnsat/data/rhnsat \
- --define RHNORA_DB_USER=$DB_USER \
- $UPGRADE_TMPL \
- | $ORACLE_HOME/bin/sqlplus /nolog \
- | cat -
-
-set +x
diff --git a/spacewalk/setup/spacewalk-setup.spec b/spacewalk/setup/spacewalk-setup.spec
index de3c12a..6bcb109 100644
--- a/spacewalk/setup/spacewalk-setup.spec
+++ b/spacewalk/setup/spacewalk-setup.spec
@@ -76,12 +76,6 @@ install -m 0644 share/defaults.d/defaults.conf
%{buildroot}/%{_datadir}/spacewal
install -d -m 755 %{buildroot}/%{_datadir}/spacewalk/setup/cobbler
install -m 0644 share/cobbler/* %{buildroot}/%{_datadir}/spacewalk/setup/cobbler/
-# Oracle specific stuff, possible candidate for sub-package down the road:
-install -d -m 755 %{buildroot}/%{_datadir}/spacewalk/setup/oracle/
-install -m 0755 share/oracle/install-db.sh
%{buildroot}/%{_datadir}/spacewalk/setup/oracle
-install -m 0755 share/oracle/remove-db.sh
%{buildroot}/%{_datadir}/spacewalk/setup/oracle
-install -m 0755 share/oracle/upgrade-db.sh
%{buildroot}/%{_datadir}/spacewalk/setup/oracle
-
# create a directory for misc. Spacewalk things
install -d -m 755 %{buildroot}/%{_var}/spacewalk