diff --git a/sysinv/cert-mon/PKG-INFO b/sysinv/cert-mon/PKG-INFO deleted file mode 100644 index 058958020c..0000000000 --- a/sysinv/cert-mon/PKG-INFO +++ /dev/null @@ -1,12 +0,0 @@ -Metadata-Version: 1.1 -Name: cert-mon -Version: 1.0 -Summary: StarlingX Certificate Montior Package -Home-page: -Author: Windriver -Author-email: info@windriver.com -License: Apache-2.0 - -Description: StarlingX Certificate Monitor Package - -Platform: UNKNOWN diff --git a/sysinv/cert-mon/centos/build_srpm.data b/sysinv/cert-mon/centos/build_srpm.data index 3701bdac03..b0740891cf 100644 --- a/sysinv/cert-mon/centos/build_srpm.data +++ b/sysinv/cert-mon/centos/build_srpm.data @@ -1,4 +1,2 @@ -SRC_DIR="." -COPY_LIST_TO_TAR="LICENSE" -EXCLUDE_LIST_FROM_TAR="centos opensuse" +SRC_DIR="files" TIS_PATCH_VER=PKG_GITREVCOUNT diff --git a/sysinv/cert-mon/centos/cert-mon.spec b/sysinv/cert-mon/centos/cert-mon.spec index 58d94914e0..6ae279cfd9 100644 --- a/sysinv/cert-mon/centos/cert-mon.spec +++ b/sysinv/cert-mon/centos/cert-mon.spec @@ -8,6 +8,7 @@ Packager: Wind River URL: unknown Source0: %{name}-%{version}.tar.gz +BuildArch: noarch BuildRequires: systemd-devel %define ocf_resourced /usr/lib/ocf/resource.d @@ -27,8 +28,8 @@ StarlingX Certificate Monitor Package %install install -m 755 -p -D cert-mon %{buildroot}/usr/lib/ocf/resource.d/platform/cert-mon install -m 644 -p -D cert-mon.service %{buildroot}%{_unitdir}/cert-mon.service - -%post +install -m 644 -p -D cert-mon.syslog %{buildroot}%{_sysconfdir}/syslog-ng/conf.d/cert-mon.conf +install -m 644 -p -D cert-mon.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/cert-mon.conf %clean @@ -43,3 +44,7 @@ rm -rf $RPM_BUILD_ROOT # systemctl service files %{_unitdir}/cert-mon.service + +# logfile config files +%{_sysconfdir}/syslog-ng/conf.d/cert-mon.conf +%{_sysconfdir}/logrotate.d/cert-mon.conf diff --git a/sysinv/cert-mon/LICENSE b/sysinv/cert-mon/files/LICENSE similarity index 100% rename from sysinv/cert-mon/LICENSE rename to sysinv/cert-mon/files/LICENSE diff --git a/sysinv/cert-mon/cert-mon b/sysinv/cert-mon/files/cert-mon similarity index 100% rename from sysinv/cert-mon/cert-mon rename to sysinv/cert-mon/files/cert-mon diff --git a/sysinv/cert-mon/files/cert-mon.logrotate b/sysinv/cert-mon/files/cert-mon.logrotate new file mode 100644 index 0000000000..6d695859e2 --- /dev/null +++ b/sysinv/cert-mon/files/cert-mon.logrotate @@ -0,0 +1,14 @@ +/var/log/cert-mon.log +{ + nodateext + size 10M + start 1 + rotate 20 + missingok + notifempty + compress + sharedscripts + postrotate + systemctl reload syslog-ng > /dev/null 2>&1 || true + endscript +} diff --git a/sysinv/cert-mon/cert-mon.service b/sysinv/cert-mon/files/cert-mon.service similarity index 100% rename from sysinv/cert-mon/cert-mon.service rename to sysinv/cert-mon/files/cert-mon.service diff --git a/sysinv/cert-mon/files/cert-mon.syslog b/sysinv/cert-mon/files/cert-mon.syslog new file mode 100644 index 0000000000..f2692ebc2e --- /dev/null +++ b/sysinv/cert-mon/files/cert-mon.syslog @@ -0,0 +1,3 @@ +filter f_certmon { facility(local6) and program(cert-mon); }; +destination d_certmon { file("/var/log/cert-mon.log"); }; +log { source(s_src); filter(f_certmon); destination(d_certmon); };