From a935278b5dbe21c717aa9cd920d9c7dbf1bfe6d5 Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 31 Mar 2021 18:38:14 +0200 Subject: [PATCH] Prevent RPMs from overwriting logrotate --- pandora_server/pandora_server.redhat.spec | 4 +++- pandora_server/pandora_server.spec | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 79f207ce33..642c15c32b 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 7299f99f84..ff5516b8c3 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