diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 373f70f794..957e39be18 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -82,7 +82,9 @@ install -m 0444 man/man1/tentacle_server.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/ rm -f $RPM_BUILD_ROOT%{prefix}/pandora_server/util/PandoraFMS rm -f $RPM_BUILD_ROOT%{prefix}/pandora_server/util/recon_scripts/PandoraFMS -install -m 0644 util/pandora_server_logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_server +if [ ! -f $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_server ] ; then + install -m 0644 util/pandora_server_logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_server +fi install -m 0640 conf/pandora_server.conf.new $RPM_BUILD_ROOT%{_sysconfdir}/pandora/pandora_server.conf.new install -m 0640 conf/tentacle_server.conf.new $RPM_BUILD_ROOT%{_sysconfdir}/tentacle/tentacle_server.conf.new diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 7024060b85..4f4cc45fd8 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -122,7 +122,12 @@ systemctl enable pandora_server.service echo "/usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf" > /etc/cron.hourly/pandora_db chmod 750 /etc/cron.hourly/pandora_db -cp -aRf /usr/share/pandora_server/util/pandora_server_logrotate /etc/logrotate.d/pandora_server + +if [ -d /etc/logrotate.d ] ; then + if [ ! -f /etc/logrotate.d/pandora_server ] ; then + cp -aRf /usr/share/pandora_server/util/pandora_server_logrotate /etc/logrotate.d/pandora_server + fi +fi if [ ! -d /etc/pandora ] ; then mkdir -p /etc/pandora diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 56561af04c..27fe60503c 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -354,9 +354,14 @@ install () { if [ -d /etc/logrotate.d ] then - [ -d $DESTDIR/etc/logrotate.d ] || mkdir -p $DESTDIR/etc/logrotate.d - echo "Creating logrotate.d entry for Pandora FMS log management" - cp util/pandora_server_logrotate $DESTDIR/etc/logrotate.d/pandora_server + if [ -f $DESTDIR/etc/logrotate.d/pandora_server ] + then + echo "A logrotate.d entry for Pandora FMS log management already exists, skipping creation" + else + echo "Creating logrotate.d entry for Pandora FMS log management" + [ -d $DESTDIR/etc/logrotate.d ] || mkdir -p $DESTDIR/etc/logrotate.d + cp util/pandora_server_logrotate $DESTDIR/etc/logrotate.d/pandora_server + fi else echo "Please add a log rotation schedule manually to your log rotation daemon (if any)" fi