From e5defb12a838c67fced96a6481160a7569b3627b Mon Sep 17 00:00:00 2001 From: slerena Date: Fri, 18 Sep 2009 17:29:18 +0000 Subject: [PATCH] 2009-09-18 Sancho Lerena * util/pandora_db.pl: Minor improvements in script. Added a switch for mode without compact. * util/pandora_server: Added higher sleep in restart mode to wait some busy threads to stop before start. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1956 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 8 ++++++++ pandora_server/util/pandora_db.pl | 11 +++++++++-- pandora_server/util/pandora_server | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 8dad6d7022..86140860ec 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,11 @@ +2009-09-18 Sancho Lerena + + * util/pandora_db.pl: Minor improvements in script. Added + a switch for mode without compact. + + * util/pandora_server: Added higher sleep in restart mode to + wait some busy threads to stop before start. + 2009-09-16 Sancho Lerena * util/pandora_exec -> bin/pandora_exec: Moved. diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index f0039921e4..14033ec24e 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -26,7 +26,7 @@ use PandoraFMS::Tools; use PandoraFMS::DB; # version: define la version actual del programa -my $version = "3.0 PS090915"; +my $version = "3.0-dev PS090917"; # Setup variables my $dirname=""; @@ -34,6 +34,8 @@ my $dbname = 'pandora'; my $dbhost =''; my $dbuser =''; my $verbosity =0; +my $onlypurge = 0; + my $dbpass=''; my $server_threshold=''; my $log_file=""; @@ -272,6 +274,7 @@ sub pandora_init { elsif ($parametro =~ m/-v\z/i) { $verbosity=5; } elsif ($parametro =~ m/-d\z/i) { $verbosity=10; } elsif ($parametro =~ m/-d\z/i) { $verbosity=0; } + elsif ($parametro =~ m/-p\z/i) { $onlypurge=1; } else { ($pandora_path = $parametro); } } if ($pandora_path eq ""){ @@ -491,6 +494,7 @@ sub help_screen{ print " -d Debug output (very verbose) \n"; print " -v Verbose output \n"; print " -q Quiet output \n"; + print " -p Only purge and consistency check, skip compact \n"; exit; } @@ -504,7 +508,10 @@ sub pandoradb_main { print "Starting at ". &UnixDate("today","%Y/%m/%d %H:%M:%S"). "\n"; pandora_purgedb ($config_days_purge, $dbname, $dbuser, $dbpass, $dbhost); pandora_checkdb_consistency ($dbname, $dbuser, $dbpass, $dbhost); - pandora_compactdb ($config_days_compact, $dbname, $dbuser, $dbpass, $dbhost); + + if ($onlypurge == 0){ + pandora_compactdb ($config_days_compact, $dbname, $dbuser, $dbpass, $dbhost); + } print "Ending at ". &UnixDate("today","%Y/%m/%d %H:%M:%S"). "\n"; exit; } diff --git a/pandora_server/util/pandora_server b/pandora_server/util/pandora_server index 34101bea61..19b9c24495 100755 --- a/pandora_server/util/pandora_server +++ b/pandora_server/util/pandora_server @@ -88,7 +88,7 @@ case "$1" in ;; force-reload|restart) $0 stop - sleep 3 + sleep 10 $0 start ;; *)