From b6cc9f820a85e42e04aa76e6ae7ea09edc0044a4 Mon Sep 17 00:00:00 2001 From: slerena Date: Tue, 1 Sep 2009 16:27:36 +0000 Subject: [PATCH] 2009-09-01 Sancho Lerena * pandora_server.spec: Using chkconfig for service install. Using the new logrotate config for automatic logfile management. * pandora_server_installer: Using new logrotate config file. * bin/pandora_server: Enterprise load notice are shown after main banner. * lib/PandoraFMS/Config.pm: Updated version (again). * util/pandora_logrotate: New conf file for /etc/logrotate.d/ git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1900 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 13 +++++++++++++ pandora_server/bin/pandora_server | 6 +++--- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.spec | 22 +++++----------------- pandora_server/pandora_server_installer | 3 +++ pandora_server/util/pandora_logrotate | 13 +++++++++++++ 6 files changed, 38 insertions(+), 21 deletions(-) create mode 100644 pandora_server/util/pandora_logrotate diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index f2aa7b04ec..e4b68db9cf 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,16 @@ +2009-09-01 Sancho Lerena + + * pandora_server.spec: Using chkconfig for service install. Using the new + logrotate config for automatic logfile management. + + * pandora_server_installer: Using new logrotate config file. + + * bin/pandora_server: Enterprise load notice are shown after main banner. + + * lib/PandoraFMS/Config.pm: Updated version (again). + + * util/pandora_logrotate: New conf file for /etc/logrotate.d/ + 2009-08-28 Ramon Novoa * pandora_server.spec, diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 93523aec56..9ab941b781 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -33,9 +33,6 @@ use PandoraFMS::WMIServer; use PandoraFMS::PluginServer; use PandoraFMS::PredictionServer; -# Load enterprise module -enterprise_load () && print " [*] Pandora FMS Enterprise module loaded.\n"; - # Global vars my %Config; my @Servers; @@ -83,6 +80,9 @@ $SIG{'ALRM'} = 'IGNORE'; pandora_init(\%Config, 'Pandora FMS Server'); pandora_load_config (\%Config); +# Load enterprise module +enterprise_load () && print " [*] Pandora FMS Enterprise module loaded.\n"; + # Daemonize and put in background if ($Config{'daemon'} == 1) { print_message (\%Config, " [*] Backgrounding Pandora FMS Server process.\n\n", 0); diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 2e582f08d6..a5ddbfe841 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -37,7 +37,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "3.0-dev"; -my $pandora_build = "PS090819"; +my $pandora_build = "PS090901"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 7da98e96cd..db5dc4181d 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -76,16 +76,11 @@ rm -fr $RPM_BUILD_ROOT exit 0 %post -ln -s /etc/init.d/pandora_server /etc/rc.d/rc5.d/S99pandora_server -ln -s /etc/init.d/pandora_server /etc/rc.d/rc3.d/S99pandora_server -ln -s /etc/init.d/pandora_server /etc/rc.d/rc2.d/S99pandora_server -ln -s /etc/init.d/pandora_server /etc/rc.d/rc0.d/K99pandora_server -ln -s /etc/init.d/tentacle_serverd /etc/rc.d/rc5.d/S99tentacle_serverd -ln -s /etc/init.d/tentacle_serverd /etc/rc.d/rc3.d/S99tentacle_serverd -ln -s /etc/init.d/tentacle_serverd /etc/rc.d/rc2.d/S99tentacle_serverd -ln -s /etc/init.d/tentacle_serverd /etc/rc.d/rc0.d/K99tentacle_serverd +chkconfig -s pandora_server on +chkconfig -s tentacle_serverd on echo "/usr/share/pandora_server/util/pandora_db /etc/pandora/pandora_server.conf" > /etc/cron.daily/pandora_db chmod 750 /etc/cron.daily/pandora_db +cp -aRf util/pandora_logrotate /etc/logrotate.d/pandora if [ ! -d /etc/pandora ] ; then mkdir -p /etc/pandora @@ -108,15 +103,8 @@ fi %if "%{_vendor}" == "redhat" /sbin/chkconfig --del pandora_server %endif -rm -Rf /etc/pandora/pandora_server.conf -rm -Rf /etc/rc.d/rc5.d/S99pandora_server -rm -Rf /etc/rc.d/rc3.d/S99pandora_server -rm -Rf /etc/rc.d/rc2.d/S99pandora_server -rm -Rf /etc/rc.d/rc0.d/K99pandora_server -rm -Rf /etc/rc.d/rc5.d/S99tentacle_serverd -rm -Rf /etc/rc.d/rc3.d/S99tentacle_serverd -rm -Rf /etc/rc.d/rc2.d/S99tentacle_serverd -rm -Rf /etc/rc.d/rc0.d/K99tentacle_serverd +chkconfig -d pandora_server +chkconfig -d tentacle_serverd %files diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 2e0f3def4e..4aed63e26a 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -146,6 +146,9 @@ install () { ln -s /usr/bin/pandora_server /usr/local/bin/pandora_server 2> /dev/null fi + echo "Creating logrotate.d entry for Pandora FMS log management" + cp util/pandora_logrotate /etc/logrotate.d/pandora + if [ "$SECOPT" != "--no-tentacle" ] then if [ "$DISTRO" == "UBUNTU" ] diff --git a/pandora_server/util/pandora_logrotate b/pandora_server/util/pandora_logrotate new file mode 100644 index 0000000000..46921d22dd --- /dev/null +++ b/pandora_server/util/pandora_logrotate @@ -0,0 +1,13 @@ +/var/log/pandora/* { + weekly + missingok + rotate 52 + compress + delaycompress + notifempty + create 640 root root + sharedscripts + postrotate + for i in `ls -1 /etc/init.d/pandora_*`;do $i stop; $i start; done + endscript +}