satellite/install/install.pl | 19 ------------------ web/modules/dobby/Dobby/CLI/MiscCommands.pm | 29 ++++++++++++++++++---------- web/modules/dobby/Dobby/DB.pm | 17 ++++++++++++++++ 3 files changed, 36 insertions(+), 29 deletions(-)
New commits: commit 4053f53a872f7fbfa468ad70e6281868226c1ff5 Author: Miroslav Suchý msuchy@redhat.com Date: Mon Oct 22 15:42:21 2012 +0200
mark set-optimizer and get-optimizer as Oracle only
diff --git a/web/modules/dobby/Dobby/CLI/MiscCommands.pm b/web/modules/dobby/Dobby/CLI/MiscCommands.pm index ea42374..57805c6 100644 --- a/web/modules/dobby/Dobby/CLI/MiscCommands.pm +++ b/web/modules/dobby/Dobby/CLI/MiscCommands.pm @@ -48,10 +48,10 @@ sub register_dobby_commands { -description => "Reset the user password and unlock account", -handler => &command_resetpassword); $cli->register_mode(-command => "get-optimizer", - -description => "Show database optimizer mode", + -description => "Show database optimizer mode (Oracle only)", -handler => &command_get_optimizer); $cli->register_mode(-command => "set-optimizer", - -description => "Set database optimizer mode", + -description => "Set database optimizer mode (Oracle only)", -handler => &command_set_optimizer); }
commit fbd3998b814c7374efc86d35e7cc02cc6ab6e403 Author: Miroslav Suchý msuchy@redhat.com Date: Mon Oct 22 15:42:11 2012 +0200
implement "db-control start" and "db-control stop" under PG
diff --git a/web/modules/dobby/Dobby/CLI/MiscCommands.pm b/web/modules/dobby/Dobby/CLI/MiscCommands.pm index 0feeb75..ea42374 100644 --- a/web/modules/dobby/Dobby/CLI/MiscCommands.pm +++ b/web/modules/dobby/Dobby/CLI/MiscCommands.pm @@ -60,16 +60,21 @@ sub command_startstop { my $command = shift;
my $d = new Dobby::DB; + my $backend = PXT::Config->get('db_backend');
if ($command eq 'start') { if ($d->instance_state ne 'OFFLINE') { print "Database already running.\n"; } else { - print "Starting database... "; - $d->database_startup; - $d->listener_startup; - print "done.\n"; + if ($backend eq 'postgresql') { + system("/sbin/service", "postgresql", "start"); + } else { + print "Starting database... "; + $d->database_startup; + $d->listener_startup; + print "done.\n"; + } } } elsif ($command eq 'stop') { @@ -77,10 +82,14 @@ sub command_startstop { print "Database already shut down.\n"; } else { - print "Shutting down database... "; - $d->listener_shutdown; - $d->database_shutdown("immediate"); - print "done.\n"; + if ($backend eq 'postgresql') { + system("/sbin/service", "postgresql", "stop"); + } else { + print "Shutting down database... "; + $d->listener_shutdown; + $d->database_shutdown("immediate"); + print "done.\n"; + } } } else {
commit b72cd6a952485b5de0d928d2e855c2d09f45eee6 Author: Miroslav Suchý msuchy@redhat.com Date: Mon Oct 22 15:41:48 2012 +0200
implement "db-control status" under PG
diff --git a/web/modules/dobby/Dobby/DB.pm b/web/modules/dobby/Dobby/DB.pm index 7fa1539..2205a46 100644 --- a/web/modules/dobby/Dobby/DB.pm +++ b/web/modules/dobby/Dobby/DB.pm @@ -16,6 +16,7 @@ use strict; package Dobby::DB; use RHN::DB; +use RHN::DBI (); use PXT::Config; use Dobby::Log;
@@ -357,8 +358,24 @@ sub connect { return $dbh; }
+sub pg_instance_state { + my $self = shift; + if (defined $RHN::DB::dbh and $RHN::DB::dbh->ping()) { + return "OPEN"; + } + my ($dsn, $login, $password, $attr) = RHN::DBI::_get_dbi_connect_parameters(); + my $dbh = eval { RHN::DB->direct_connect($dsn, $login, $password, $attr) }; + return $dbh ? "OPEN" : "OFFLINE"; +} + sub instance_state { my $self = shift; + my $backend = PXT::Config->get('db_backend'); + return ($backend eq 'postgresql') ? $self->pg_instance_state : $self->ora_instance_state; +} + +sub ora_instance_state { + my $self = shift; # ORA-01033 -- startup/shutdown in progress (mounted but not open) # ORA-01089 -- immediate startup/shutdown in progress (shutdown in progress) # ORA-01034 -- oracle not available
commit 6c75416f40d8647b63f2b7a2050bde2e44f08f3b Author: Miroslav Suchý msuchy@redhat.com Date: Mon Oct 22 15:40:04 2012 +0200
527190 - remove_php_packages in installer not needed
diff --git a/satellite/install/install.pl b/satellite/install/install.pl index d48726a..afff022 100755 --- a/satellite/install/install.pl +++ b/satellite/install/install.pl @@ -65,8 +65,6 @@ do_precondition_checks(%opts, %answers);
print loc("* Pre-install checks complete. Beginning installation.\n");
-remove_php_packages(); - print loc("* RHN Registration.\n"); rhn_register(%opts, %answers, %up2dateOptions, %rhnOptions);
@@ -275,23 +273,6 @@ sub python_path { return $path; }
-sub remove_php_packages { - my @packages = `rpm -qa | grep -E '(php|piranha|squirrelmail|specspo)'`; - - if (@packages) { - for (@packages) { - chomp; - } - my $ret = system_debug('rpm', '-e', @packages); - - if ($ret) { - die "Could not remove php packages: " . join(', ', @packages) . "\n"; - } - } - - return 1; -} - sub system_is_registered { my $ret = system_debug('/usr/sbin/rhn_check');
spacewalk-commits@lists.fedorahosted.org