2013-05-22 Ramon Novoa <rnovoa@artica.es>

* pandora_server.spec,
	  pandora_server.redhat.spec,
	  DEBIAN/postinst,
	  DEBIAN/conffiles,
	  DEBIAN/make_deb_package.sh,
	  conf/pandora_server.conf.new,
	  pandora_server_installer: Merged Sancho's changes from 4.0 branch.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8191 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2013-05-22 16:58:14 +00:00
parent 9eeef8bb08
commit 3b779d72c9
8 changed files with 49 additions and 32 deletions

View File

@ -1,3 +1,13 @@
2013-05-22 Ramon Novoa <rnovoa@artica.es>
* pandora_server.spec,
pandora_server.redhat.spec,
DEBIAN/postinst,
DEBIAN/conffiles,
DEBIAN/make_deb_package.sh,
conf/pandora_server.conf.new,
pandora_server_installer: Merged Sancho's changes from 4.0 branch.
2013-05-20 Ramon Novoa <rnovoa@artica.es> 2013-05-20 Ramon Novoa <rnovoa@artica.es>
* util/pandora_xml_stress.pl: Added support for strictly incremental * util/pandora_xml_stress.pl: Added support for strictly incremental

View File

@ -1 +0,0 @@
/etc/pandora/pandora_server.conf

View File

@ -68,7 +68,6 @@ then
mkdir -p temp_package/usr/sbin/ mkdir -p temp_package/usr/sbin/
mkdir -p temp_package/etc/init.d/ mkdir -p temp_package/etc/init.d/
mkdir -p temp_package/etc/pandora/ mkdir -p temp_package/etc/pandora/
touch temp_package/etc/pandora/pandora_server.conf
mkdir -p temp_package/var/spool/pandora/data_in mkdir -p temp_package/var/spool/pandora/data_in
chmod 770 temp_package/var/spool/pandora/data_in chmod 770 temp_package/var/spool/pandora/data_in
mkdir -p temp_package/var/spool/pandora/data_in/conf mkdir -p temp_package/var/spool/pandora/data_in/conf

View File

@ -72,13 +72,13 @@ echo "Creating setup directory in /etc/pandora"
mkdir /etc/pandora 2> /dev/null mkdir /etc/pandora 2> /dev/null
#Check if exist old conf file #Check if exist old conf file
count_lines_conf=`cat /etc/pandora/pandora_server.conf | wc -l` if [ ! -e /etc/pandora/pandora_server.conf ]
if [ $count_lines_conf -eq 0 ]
then then
rm /etc/pandora/pandora_server.conf cp /usr/share/pandora_server/conf/pandora_server.conf.new /etc/pandora/pandora_server.conf
ln -s /usr/share/pandora_server/conf/pandora_server.conf /etc/pandora/ chmod 600 /etc/pandora/pandora_server.conf
chmod 770 /etc/pandora/pandora_server.conf else
cp /usr/share/pandora_server/conf/pandora_server.conf.new /etc/pandora/pandora_server.conf.new
echo "Skipping creation of pandora_server.conf: there is already one."
fi fi
echo "Linking startup script to /etc/rc2.d" echo "Linking startup script to /etc/rc2.d"

View File

@ -76,7 +76,7 @@ rm -f $RPM_BUILD_ROOT%{prefix}/pandora_server/util/PandoraFMS
rm -f $RPM_BUILD_ROOT%{prefix}/pandora_server/util/recon_scripts/PandoraFMS rm -f $RPM_BUILD_ROOT%{prefix}/pandora_server/util/recon_scripts/PandoraFMS
install -m 0644 util/pandora_logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_server install -m 0644 util/pandora_logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_server
install -m 0640 conf/pandora_server.conf $RPM_BUILD_ROOT%{_sysconfdir}/pandora/ install -m 0640 conf/pandora_server.conf.new $RPM_BUILD_ROOT%{_sysconfdir}/pandora/pandora_server.conf.new
cat <<EOF > $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/pandora_db cat <<EOF > $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/pandora_db
#!/bin/bash #!/bin/bash
@ -91,11 +91,6 @@ rm -fr $RPM_BUILD_ROOT
getent passwd pandora >/dev/null || \ getent passwd pandora >/dev/null || \
/usr/sbin/useradd -d %{prefix}/pandora_server -s /sbin/nologin -M -g 0 pandora /usr/sbin/useradd -d %{prefix}/pandora_server -s /sbin/nologin -M -g 0 pandora
if [ -e "/etc/pandora/pandora_server.conf" ]
then
cat /etc/pandora/pandora_server.conf > /etc/pandora/pandora_server.conf.old
fi
exit 0 exit 0
%post %post
@ -113,6 +108,18 @@ if [ "$1" = 1 ]; then
echo " " echo " "
fi fi
# This will avoid pandora_server.conf overwritting on UPGRADES.
if [ ! -e "/etc/pandora/pandora_server.conf" ]
then
echo "Creating a new version of Pandora FMS Server config file at /etc/pandora/pandora_server.conf"
cat /etc/pandora/pandora_server.conf.new > /etc/pandora/pandora_server.conf
else
# Do a copy of current .conf, just in case.
echo "An existing version of pandora_server.conf is found."
cat /etc/pandora/pandora_server.conf > /etc/pandora/pandora_server.conf.old
fi
echo "Don't forget to start Tentacle Server daemon if you want to receive" echo "Don't forget to start Tentacle Server daemon if you want to receive"
echo "data using tentacle" echo "data using tentacle"
@ -151,9 +158,11 @@ exit 0
%{_bindir}/tentacle_server %{_bindir}/tentacle_server
%dir %{_localstatedir}/log/pandora %dir %{_localstatedir}/log/pandora
%dir %{_sysconfdir}/pandora %dir %{_sysconfdir}/pandora
%config(noreplace) %{_sysconfdir}/pandora/pandora_server.conf
%dir %{_localstatedir}/spool/pandora %dir %{_localstatedir}/spool/pandora
%defattr(600,root,root)
/etc/pandora/pandora_server.conf.new
%defattr(770,pandora,apache) %defattr(770,pandora,apache)
%{_localstatedir}/spool/pandora/data_in %{_localstatedir}/spool/pandora/data_in

View File

@ -80,8 +80,8 @@ cp -aRf util/tentacle_serverd $RPM_BUILD_ROOT/etc/init.d/
cp -aRf man/man1/pandora_server.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/ cp -aRf man/man1/pandora_server.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
cp -aRf man/man1/tentacle_server.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/ cp -aRf man/man1/tentacle_server.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
rm -f $RPM_BUILD_ROOT%{prefix}/pandora_server/util/PandoraFMS rm -Rf $RPM_BUILD_ROOT%{prefix}/pandora_server/util/PandoraFMS
rm -f $RPM_BUILD_ROOT%{prefix}/pandora_server/util/recon_scripts/PandoraFMS rm -Rf $RPM_BUILD_ROOT%{prefix}/pandora_server/util/recon_scripts/PandoraFMS
%clean %clean
rm -fr $RPM_BUILD_ROOT rm -fr $RPM_BUILD_ROOT
@ -91,11 +91,7 @@ if [ "`id pandora | grep uid | wc -l`" = 0 ]
then then
/usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora /usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora
fi fi
exit 0
if [ -e "/etc/pandora/pandora_server.conf" ]
then
cat /etc/pandora/pandora_server.conf > /etc/pandora/pandora_server.conf.old
fi
%post %post
chkconfig pandora_server on chkconfig pandora_server on
@ -109,18 +105,21 @@ if [ ! -d /etc/pandora ] ; then
mkdir -p /etc/pandora mkdir -p /etc/pandora
fi fi
if [ ! -e /etc/pandora/pandora_server.conf ] ; then if [ ! -e "/etc/pandora/pandora_server.conf" ]
ln -s /usr/share/pandora_server/conf/pandora_server.conf /etc/pandora/ then
echo "Pandora FMS Server configuration is /etc/pandora/pandora_server.conf" echo "Creating a new version of Pandora FMS Server config file at /etc/pandora/pandora_server.conf"
echo "Pandora FMS Server main directory is %{prefix}/pandora_server/" cat /etc/pandora/pandora_server.conf.new > /etc/pandora/pandora_server.conf
echo "The manual can be reached at: man pandora or man pandora_server" else
echo "Pandora FMS Documentation is in: http://pandorafms.org" # Do a copy of current .conf, just in case.
echo " " echo "An existing version of pandora_server.conf is found."
cat /etc/pandora/pandora_server.conf > /etc/pandora/pandora_server.conf.old
fi fi
echo "Don't forget to start Tentacle Server daemon if you want to receive" echo "Don't forget to start Tentacle Server daemon if you want to receive"
echo "data using tentacle" echo "data using tentacle"
exit 0
%preun %preun
# Upgrading # Upgrading
@ -145,7 +144,7 @@ rm -Rf /etc/init.d/pandora_server
rm -Rf %{prefix}pandora_server rm -Rf %{prefix}pandora_server
rm -Rf /var/log/pandora rm -Rf /var/log/pandora
rm -Rf /usr/lib/perl5/PandoraFMS/ rm -Rf /usr/lib/perl5/PandoraFMS/
rm -Rf /etc/pandora/pandora_server.conf rm -Rf /etc/pandora/pandora_server.conf*
rm -Rf /var/spool/pandora rm -Rf /var/spool/pandora
rm -Rf /etc/init.d/pandora_server /etc/init.d/tentacle_serverd rm -Rf /etc/init.d/pandora_server /etc/init.d/tentacle_serverd
rm -Rf /usr/bin/pandora_exec /usr/bin/pandora_server /usr/bin/tentacle_server rm -Rf /usr/bin/pandora_exec /usr/bin/pandora_server /usr/bin/tentacle_server

View File

@ -297,8 +297,8 @@ perl-TimeDate perl-XML-Simple perl-XML-Twig perl-libwww-perl mysql-client"
echo cp NetBSD/pandora_server.conf $PANDORA_CFG_DIR echo cp NetBSD/pandora_server.conf $PANDORA_CFG_DIR
cp NetBSD/pandora_server.conf $PANDORA_CFG_DIR cp NetBSD/pandora_server.conf $PANDORA_CFG_DIR
else else
echo cp conf/pandora_server.conf $PANDORA_CFG_DIR echo cp conf/pandora_server.conf.new $PANDORA_CFG_DIR
cp conf/pandora_server.conf $PANDORA_CFG_DIR cp conf/pandora_server.conf.new $PANDORA_CFG_DIR
fi fi
chmod 770 $PANDORA_CFG_FILE chmod 770 $PANDORA_CFG_FILE
@ -549,6 +549,7 @@ uninstall () {
rm -Rf $PANDORA_LOG 2> /dev/null rm -Rf $PANDORA_LOG 2> /dev/null
rm -Rf $PANDORA_CFG_FILE 2> /dev/null rm -Rf $PANDORA_CFG_FILE 2> /dev/null
rm -Rf "$PANDORA_CFG_FILE.new" 2> /dev/null
rm -Rf $PANDORA_SERVER 2> /dev/null rm -Rf $PANDORA_SERVER 2> /dev/null
rm -Rf /usr/bin/pandora_server 2> /dev/null rm -Rf /usr/bin/pandora_server 2> /dev/null
rm -Rf /usr/bin/pandora_exec 2> /dev/null rm -Rf /usr/bin/pandora_exec 2> /dev/null