import insights-client-3.1.1-1.el8_3

This commit is contained in:
CentOS Sources 2021-03-30 16:02:22 -04:00 committed by Stepan Oksanichenko
parent 2c72419d71
commit 772c383606
5 changed files with 44 additions and 104 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/insights-client-3.0.14.tar.gz
SOURCES/insights-client-3.1.1.tar.gz

View File

@ -1 +1 @@
e67aa1adab226f13ffc066a628352bf1dc6cff6d SOURCES/insights-client-3.0.14.tar.gz
b20ae53eb3bd1954f0cd9de9d1f131452d9395ab SOURCES/insights-client-3.1.1.tar.gz

View File

@ -1,74 +0,0 @@
From aa5d5860146e6b5c76da4746f18b64313cc848e9 Mon Sep 17 00:00:00 2001
From: Link Dupont <subpop@users.noreply.github.com>
Date: Fri, 1 May 2020 13:20:52 -0400
Subject: [PATCH] Fix shellcheck warnings (#117)
* Explicitly invoke bash as the interpreter
* Allow shellcheck to follow external sources
* Test cgconfig check directly - Fixes SC2181
* Remove unncessary variable prefix - Fixes SC2004
* Quote test for ENABLE_CHECK_RESULTS - Fixes SC2070
* Quote $0 properly inside $() context - Fixes SC2086
* Quote the arguments before execing insights-client - Fixes SC2068
* Fix shellcheck errors in autogen.sh
* Update the cgroup check to be more explicit
---
data/cron/insights-client.cron | 12 ++++++------
src/redhat-access-insights.in | 4 ++--
3 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/data/cron/insights-client.cron b/data/cron/insights-client.cron
index aa5cff6..82add66 100644
--- a/data/cron/insights-client.cron
+++ b/data/cron/insights-client.cron
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# This file is part of insights-client.
#
@@ -13,13 +13,13 @@ RANDOM_DELAY_SEC=14400
ENABLE_CHECK_RESULTS="yes"
if [ -f /etc/sysconfig/insights-client ]; then
+ # shellcheck source=insights-client
. /etc/sysconfig/insights-client
fi
-DELAY=$((1 + RANDOM % ${RANDOM_DELAY_SEC}))
+DELAY=$((1 + RANDOM % RANDOM_DELAY_SEC))
/bin/sleep ${DELAY}
-/sbin/service cgconfig status > /dev/null 2>&1
-if [ $? == 0 ];
+if [ "$(/sbin/service cgconfig status)" == "Running" ];
then
/bin/cgcreate -g memory,cpu,blkio:insights
/bin/cgset -r memory.limit_in_bytes=2147483648 insights
@@ -29,13 +29,13 @@ then
/bin/cgset -r blkio.weight=100 insights
/bin/cgexec -g memory,cpu,blkio:insights /usr/bin/timeout 10m ${path} --retry 3 --quiet
/bin/cgdelete memory,cpu,blkio:insights
- if [ -n ${ENABLE_CHECK_RESULTS} ]; then
+ if [[ -n ${ENABLE_CHECK_RESULTS} ]]; then
/bin/sleep 120
${path} --check-results
fi
else
/usr/bin/timeout 10m ${path} --quiet
- if [ -n ${ENABLE_CHECK_RESULTS} ]; then
+ if [[ -n ${ENABLE_CHECK_RESULTS} ]]; then
/bin/sleep 120
/usr/bin/timeout 10m ${path} --check-results
fi
diff --git a/src/redhat-access-insights.in b/src/redhat-access-insights.in
index dfa016b..62f7bfe 100644
--- a/src/redhat-access-insights.in
+++ b/src/redhat-access-insights.in
@@ -1,5 +1,5 @@
#!/bin/sh
-echo "WARNING: $(basename $0) is deprecated and will be removed in a future release; use 'insights-client' instead."
+echo "WARNING: $(basename "$0") is deprecated and will be removed in a future release; use 'insights-client' instead."
sleep 3
-exec @bindir@/insights-client $@
+exec @bindir@/insights-client "$@"

View File

@ -1,13 +0,0 @@
--- a/configure.orig 2020-06-11 10:25:02.853487027 -0400
+++ b/configure 2020-06-11 10:25:12.149398946 -0400
@@ -3269,8 +3269,8 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for motd_d support" >&5
$as_echo_n "checking for motd_d support... " >&6; }
have_motdd=no
-if test -f /usr/lib64/security/pam_motd.so; then
- $STRINGS /usr/lib64/security/pam_motd.so | grep -q "motd_dir="
+if test -f $libdir/security/pam_motd.so; then
+ $STRINGS $libdir/security/pam_motd.so | grep -q "motd_dir="
if test $? -eq 0; then
have_motdd=yes
fi

View File

@ -2,13 +2,9 @@
Name: insights-client
Summary: Uploads Insights information to Red Hat on a periodic basis
Version: 3.0.14
Release: 2%{?dist}
Source0: https://github.com/redhatinsights/insights-client/archive/insights-client-%{version}.tar.gz
# RHCLOUD-6204: fix error in cron that correctly disables results check
Patch0: RHCLOUD-6204-fix-shellcheck-warnings-aa5d586.patch
# It's not safe to assume pam modules exist in /usr/lib64
Patch1: configure-use-libdir.patch
Version: 3.1.1
Release: 1%{?dist}
Source0: https://github.com/RedHatInsights/insights-client/releases/download/v%{version}/insights-client-%{version}.tar.gz
Epoch: 0
License: GPLv2+
URL: http://cloud.redhat.com/insights
@ -55,8 +51,7 @@ Sends insightful information to Red Hat for automated analysis
%install
%{make_install}
%{__install} -d -m 755 %{buildroot}/%{_localstatedir}/log/insights-client
%{__install} -d -m 755 %{buildroot}/%{_localstatedir}/lib/insights
%{__install} -D -m 644 %{_builddir}/%{name}-%{version}/data/insights-client.motd %{buildroot}/%{_sysconfdir}/insights-client/insights-client.motd
%post
@ -71,22 +66,30 @@ if [ -d %{_sysconfdir}/motd.d ]; then
fi
fi
%systemd_post insights-register.path
%systemd_post insights-unregister.path
%preun
%systemd_preun %{name}.timer
%systemd_preun %{name}.service
%systemd_preun insights-register.path
%systemd_preun insights-unregister.path
%postun
%systemd_postun %{name}.timer
%systemd_postun %{name}.service
%systemd_postun insights-register.path
%systemd_postun insights-unregister.path
# Clean up files created by insights-client that are unowned by the RPM
if [ $1 -eq 0 ]; then
systemctl unmask insights-register.path
rm -f %{_sysconfdir}/cron.daily/insights-client
rm -f %{_sysconfdir}/ansible/facts.d/insights.fact
rm -f %{_sysconfdir}/ansible/facts.d/insights_machine_id.fact
rm -f %{_sysconfdir}/motd.d/insights-client
rm -f %{_localstatedir}/lib/insights/*
rm -rf %{_localstatedir}/lib/insights
rm -rf %{_localstatedir}/log/insights-client
fi
@ -102,11 +105,9 @@ rm -rf %{buildroot}
%{_sysconfdir}/insights-client/rpm.egg*
%{_bindir}/*
%{_unitdir}/*
%attr(440,root,root) %{_sysconfdir}/insights-client/*.pem
%attr(440,root,root) %{_sysconfdir}/insights-client/redhattools.pub.gpg
%attr(444,root,root) %{_sysconfdir}/insights-client/*.pem
%attr(444,root,root) %{_sysconfdir}/insights-client/redhattools.pub.gpg
%{python3_sitelib}/insights_client/
%{_localstatedir}/log/insights-client
%{_localstatedir}/lib/insights
%{_defaultdocdir}/%{name}
@ -117,6 +118,23 @@ rm -rf %{buildroot}
%changelog
* Thu Nov 19 2020 Link Dupont <link@redhat.com> - 3.1.1-1
- New upstream release (RHBZ#1899590)
* Thu Aug 20 2020 Link Dupont <link@redhat.com> - 3.1.0-3
- Backport patch to disable sleeping a systemd unit (RHBZ#1870656)
* Tue Aug 11 2020 Link Dupont <link@redhat.com> - 3.1.0-2
- Disable automatic registration of insights-client (RHBZ#1868116)
* Thu Jul 23 2020 Link Dupont <link@redhat.com> - 3.1.0-1
- First release with core collection as the default collection medium
- Manpage and configuration updates for core collection parameters (RHCLOUD-4266)
* Fri Jul 17 2020 Link Dupont <link@redhat.com> - 3.0.15-1
- Insights is automatically registered when a host is subscribed to RHSM (RHCLOUD-6538)
- Disable results checking by default (RHCLOUD-6204)
* Thu Jun 11 2020 Link Dupont <link@redhat.com> - 3.0.14-2
- Backport patch that fixes shellcheck warnings (RHCLOUD-6204)
@ -181,6 +199,15 @@ rm -rf %{buildroot}
* Tue Jun 5 2018 Jeremy Crafts <jcrafts@redhat.com> - 3.0.4-0
- Initial RHEL 8 build
* Wed Mar 14 2018 Richard Brantley <rbrantle@redhat.com> - 3.0.3-8
- Resolves: rhbz#1555041
* Fri Feb 16 2018 Kyle Lape <klape@redhat.com> - 3.0.3-6
- Persist systemd timer config between reboots
* Wed Feb 7 2018 Kyle Lape <klape@redhat.com> - 3.0.3-2
- Correct the version strings in Obsoletes and Provides in RPM spec
* Thu Jan 18 2018 Kyle Lape <klape@redhat.com> - 3.0.3-1
- RHEL 7 RPM now uses systemd service and timer instead of cron
- Addition of IO and CPU cgroup constraints