From 5d0fb10e0a72edfeb6bc4fd95429647158edbf8f Mon Sep 17 00:00:00 2001 From: slerena Date: Mon, 21 Sep 2009 00:34:14 +0000 Subject: [PATCH] 2009-09-21 Sancho Lerena * pandora_server.spec: Fixed a few details. * bin/pandora_server: Error handler needs to be reviewed, Enterprise errors are too nasty :( * util/tentacle_serverd: Fixed LSB tags problems for RPM install * util/pandora_server: Fixed LSB tags problems and fix a bug who make script inusable :( git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1960 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 12 ++++++++++ pandora_server/bin/pandora_server | 4 +++- pandora_server/pandora_server.spec | 6 ++--- pandora_server/util/pandora_server | 36 +++++++++++++++------------- pandora_server/util/tentacle_serverd | 29 ++++++++++++---------- 5 files changed, 55 insertions(+), 32 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 86140860ec..374a28e743 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,15 @@ +2009-09-21 Sancho Lerena + + * pandora_server.spec: Fixed a few details. + + * bin/pandora_server: Error handler needs to be reviewed, Enterprise + errors are too nasty :( + + * util/tentacle_serverd: Fixed LSB tags problems for RPM install + + * util/pandora_server: Fixed LSB tags problems and fix a bug who make + script inusable :( + 2009-09-18 Sancho Lerena * util/pandora_db.pl: Minor improvements in script. Added diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index bcc6f6425f..71eb6f4ee8 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -71,7 +71,9 @@ sub pandora_crash () { $SIG{'TERM'} = 'pandora_shutdown'; $SIG{'INT'} = 'pandora_shutdown'; -$SIG{__DIE__} = 'pandora_crash'; + +# Error handler needs to be reviewed, Enterprise not found errors are too nasty :( +#$SIG{__DIE__} = 'pandora_crash'; # Prevent alarm from bombing the main thread when called within a thread $SIG{'ALRM'} = 'IGNORE'; diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 0c2c852230..8ba1acf997 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -21,8 +21,8 @@ BuildArchitectures: noarch Requires(pre): /usr/sbin/useradd AutoReq: 0 Provides: %{name}-%{version} -Requires: perl-mail-sendmail perl-DBI perl-DBD-mysql perl-time-format -Requires: perl-mail-sendmail perl-netaddr-ip net-snmp +Requires: perl-Mail-Sendmail perl-DBI perl-DBD-mysql perl-time-format +Requires: perl-NetAddr-IP net-snmp Requires: nmap wmic sudo %description @@ -82,7 +82,7 @@ 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 +cp -aRf /usr/share/pandora_server/util/pandora_logrotate /etc/logrotate.d/pandora if [ ! -d /etc/pandora ] ; then mkdir -p /etc/pandora diff --git a/pandora_server/util/pandora_server b/pandora_server/util/pandora_server index 19b9c24495..ba3e159e3e 100755 --- a/pandora_server/util/pandora_server +++ b/pandora_server/util/pandora_server @@ -1,21 +1,25 @@ -#!/bin/bash - -# Pandora FMS Server, startup script -# Copyright (c) 2006-2009 Sancho Lerena, -# Linux Version (generic), for SuSe, Debian and Ubuntu. -# other Linux distros could not work properly without modifications -# v3.0 Build 090915 -# http://www.pandorafms.com - -### BEGIN INIT INTO -# Provides: pandora_server -# Default-Start: 2 3 5 -# Default-Stop: 0 1 2 3 5 -# Required-Start: $network -# Required-Stop: $network +#! /bin/sh +# Copyright (c) 2005-2009 Artica ST +# +# Author: Sancho Lerena 2006-2009 +# +# /etc/init.d/pandora_server +# +# System startup script for Pandora FMS +# +### BEGIN INIT INFO +# Provides: pandora_server +# Required-Start: $syslog mysql +# Should-Start: $network +# Required-Stop: $syslog mysql +# Should-Stop: $network mysql +# Default-Start: 2 3 5 +# Default-Stop: 0 1 6 # Short-Description: Pandora FMS Server startup script +# Description: Pandora FMS Server startup script ### END INIT INFO + PANDORA_HOME="/etc/pandora/pandora_server.conf" PANDORA_PID_PATH="/var/run" PANDORA_PID=$PANDORA_PID_PATH/pandora_server.pid @@ -25,7 +29,7 @@ PANDORA_DAEMON=/usr/local/bin/pandora_server # This function replace pidof, not working in the same way in different linux distros function pidof_pandora () ( - PANDORA_PID=`ps aux | grep $PANDORA_DAEMON $PANDORA_HOME| grep -v grep | tail -1 | awk '{ print $2 }'` + PANDORA_PID=`ps aux | grep "$PANDORA_DAEMON $PANDORA_HOME" | grep -v grep | tail -1 | awk '{ print $2 }'` echo $PANDORA_PID ) diff --git a/pandora_server/util/tentacle_serverd b/pandora_server/util/tentacle_serverd index 8161a0af52..17aeae6ec5 100755 --- a/pandora_server/util/tentacle_serverd +++ b/pandora_server/util/tentacle_serverd @@ -1,17 +1,22 @@ -#!/bin/bash - -# Tentacle server simple startup script -# Copyright (c) 2007 Artica Soluciones Tecnologicas S.L. -# Linux Version (generic) -# v0.1 Build 090827 - -### BEGIN INIT INTO -# Provides: tentacle_server -# Default-Start: 2 3 5 -# Default-Stop: 0 1 2 3 5 +#! /bin/sh +# Copyright (c) 2005-2009 Artica ST +# +# Author: Sancho Lerena 2006-2009 +# +# /etc/init.d/tentacle_server +# +# System startup script for Tentacle Server +# +### BEGIN INIT INFO +# Provides: tentacle_server # Required-Start: $network -# Required-Stop: $network +# Should-Start: $syslog +# Required-Stop: $network +# Should-Stop: $network +# Default-Start: 2 3 5 +# Default-Stop: 0 1 6 # Short-Description: Tentacle Server startup script +# Description: Tentacle Server startup script ### END INIT INFO # Pandora server settings