Compare commits

...

No commits in common. "c8" and "c8s" have entirely different histories.
c8 ... c8s

7 changed files with 111 additions and 167 deletions

3
.gitignore vendored
View File

@ -1,2 +1 @@
SOURCES/insights-client-3.1.7.tar.gz
SOURCES/insights-core.egg
SOURCES/insights-client-3.0.14.tar.gz

View File

@ -1,2 +1 @@
0862807b4cb4e8bcbb6bad73e4d689da8f320bf8 SOURCES/insights-client-3.1.7.tar.gz
6113b8e15d58f13779a85f1e53773da28ec63ca7 SOURCES/insights-core.egg
e67aa1adab226f13ffc066a628352bf1dc6cff6d SOURCES/insights-client-3.0.14.tar.gz

View File

@ -1,26 +0,0 @@
From 844a3294541fb84bd742826ca8c110c05ad9b4fd Mon Sep 17 00:00:00 2001
From: Link Dupont <link@sub-pop.net>
Date: Mon, 31 Jan 2022 10:53:04 -0500
Subject: [PATCH] fix: remove PathExists condition from unit
The PathExists= directive in the Path section of the
insights-client-results.path unit is unnecessary.
Fixes: RHBZ#2022191
(cherry picked from commit ec3502eaef144838bec85dfed497de7a404a66bf)
---
data/systemd/insights-client-results.path.in | 1 -
1 file changed, 1 deletion(-)
diff --git a/data/systemd/insights-client-results.path.in b/data/systemd/insights-client-results.path.in
index be53998..928296b 100644
--- a/data/systemd/insights-client-results.path.in
+++ b/data/systemd/insights-client-results.path.in
@@ -13,7 +13,6 @@ Documentation=man:insights-client(8)
PartOf=insights-client.timer
[Path]
-PathExists=@pkgsysconfdir@/.lastupload
PathModified=@pkgsysconfdir@/.lastupload
[Install]

View File

@ -0,0 +1,74 @@
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

@ -0,0 +1,13 @@
--- 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

@ -1,17 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIVAwUAY2PHlnUU932DZrDZAQipRg//erkkOLyV++i0nhK+AqOdvYNLzjPIGSas
p33F0n5nRYjE/pP/a5bOSrlIDqhx5W0L3obAxQqJ1WNfsTpi0e/ixKJFcM+vSDQC
xzMNoHmyaE+/SqaOgzaSciHPfFme+m30G2VaUV+tKK7/GSiqbsdYpQGTV+fEC3Kp
2kmB6udN2K7BK54yHEYPdaOoB1zkBDklwi/hgdKILMZ8Zyjrihj3ExUIz5prZBTy
XoYYFq+u+TJn7Abhb1xDneMqr2Aba42DfFahL4Jqek6cBPG58m1CVZ9tp7ajof53
dTFimJVzTEVCVYY8D6grV0KosTDLYR/A8vRo/dtYf/F6SqoBA26c77p19oBaXG1O
OTS+36t+FHxvKNY0JYcpD9TwNxGk5VSqjJVxF0pFqHZfsX8ZxiT4oGdp4l10pQ1H
zqFNRB9QDMLKN+utK0BmpycVsWvxf0WWTFmtw3ysgsLtA+w9sYaSK21Uprti178o
jQF7KBIxTwFLRvJmxIJ9JaKnKSkOTw2TJw8RF9N4oCf582V7TmFifRVTx+L/SxiJ
tJx5P+aDzTI9HVwNKwiyy2uoXob3amqxs9fedvHhbIUe65ZWA705Tj8p3Y1NvKhE
cYvrkJ/QD+aiZA3XyO5nZcGkqz5TCKRJMR6T5VslZ8nHdR/Nsa7m/m1hoONOos1N
eUib1m4rXag=
=izRE
-----END PGP SIGNATURE-----

View File

@ -2,22 +2,19 @@
Name: insights-client
Summary: Uploads Insights information to Red Hat on a periodic basis
Version: 3.1.7
Release: 12%{?dist}
Source0: https://github.com/RedHatInsights/insights-client/releases/download/v%{version}/insights-client-%{version}.tar.gz
Source1: https://api.access.redhat.com/r/insights/v1/static/core/insights-core.egg
Source2: https://api.access.redhat.com/r/insights/v1/static/core/insights-core.egg.asc
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
Epoch: 0
License: GPLv2+
URL: https://console.redhat.com/insights
URL: http://cloud.redhat.com/insights
Group: Applications/System
Vendor: Red Hat, Inc.
#
# patches_ignore=DROP-IN-RPM
# patches_base=3.1.7
Patch0001: 0001-fix-remove-PathExists-condition-from-unit.patch
Provides: redhat-access-insights = %{version}-%{release}%{?dist}
Obsoletes: redhat-access-insights <= 1.0.13-2
@ -29,7 +26,6 @@ Requires: tar
Requires: gpg
Requires: pciutils
%global __python3 /usr/libexec/platform-python
%{?__python3:Requires: %{__python3}}
%{?systemd_requires}
Requires: python3-requests >= 2.6
@ -41,10 +37,8 @@ Requires: coreutils
BuildRequires: wget
BuildRequires: binutils
BuildRequires: python3-devel
BuildRequires: platform-python-devel
BuildRequires: systemd
BuildRequires: pam
Requires(post): policycoreutils-python-utils
%description
@ -55,25 +49,18 @@ Sends insightful information to Red Hat for automated analysis
%build
%{configure} PYTHON=%{__python3}
%{configure} PYTHON=%{_libexecdir}/platform-python
%{__make}
%install
%{make_install}
%{__install} -D -m 644 %{_builddir}/%{name}-%{version}/data/insights-client.motd %{buildroot}/%{_sysconfdir}/insights-client/insights-client.motd
%{__install} -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/insights-client/rpm.egg
%{__install} -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/insights-client/rpm.egg.asc
%{__install} -d -m 755 %{buildroot}/%{_localstatedir}/log/insights-client
%{__install} -d -m 755 %{buildroot}/%{_localstatedir}/lib/insights
# Create different insights directories in /var
mkdir -p %{buildroot}%{_localstatedir}/log/insights-client/
mkdir -p %{buildroot}%{_localstatedir}/lib/insights/
mkdir -p %{buildroot}%{_localstatedir}/cache/insights/
mkdir -p %{buildroot}%{_localstatedir}/cache/insights-client/
%post
%systemd_post %{name}.timer
%systemd_post %{name}-boot.service
if [ -d %{_sysconfdir}/motd.d ]; then
if [ ! -e %{_sysconfdir}/motd.d/insights-client -a ! -L %{_sysconfdir}/motd.d/insights-client ]; then
if [ -e %{_localstatedir}/lib/insights/newest.egg ]; then
@ -84,37 +71,29 @@ if [ -d %{_sysconfdir}/motd.d ]; then
fi
fi
if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
/usr/sbin/semanage permissive --add insights_client_t || true
fi
%preun
%systemd_preun %{name}.timer
%systemd_preun %{name}.service
%systemd_preun %{name}-boot.service
%postun
%systemd_postun %{name}.timer
%systemd_postun %{name}.service
%systemd_postun %{name}-boot.service
if [ $1 -eq 0 ]; then
if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
/usr/sbin/semanage permissive --delete insights_client_t || true
fi
fi
# Clean up files created by insights-client that are unowned by the RPM
if [ $1 -eq 0 ]; then
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 -rf %{_localstatedir}/lib/insights
rm -rf %{_localstatedir}/log/insights-client
rm -f %{_sysconfdir}/insights-client/.*.etag
rm -f %{_localstatedir}/lib/insights/*
fi
%clean
rm -rf %{buildroot}
%files
%config(noreplace) %{_sysconfdir}/insights-client/*.conf
%{_sysconfdir}/insights-client/insights-client.motd
@ -123,15 +102,12 @@ fi
%{_sysconfdir}/insights-client/rpm.egg*
%{_bindir}/*
%{_unitdir}/*
%attr(444,root,root) %{_sysconfdir}/insights-client/*.pem
%attr(444,root,root) %{_sysconfdir}/insights-client/redhattools.pub.gpg
%attr(440,root,root) %{_sysconfdir}/insights-client/*.pem
%attr(440,root,root) %{_sysconfdir}/insights-client/redhattools.pub.gpg
%{python3_sitelib}/insights_client/
%{_localstatedir}/log/insights-client
%{_localstatedir}/lib/insights
%{_defaultdocdir}/%{name}
%{_presetdir}/*.preset
%attr(700,root,root) %dir %{_localstatedir}/log/insights-client/
%attr(700,root,root) %dir %{_localstatedir}/cache/insights-client/
%attr(750,root,root) %dir %{_localstatedir}/cache/insights/
%attr(750,root,root) %dir %{_localstatedir}/lib/insights/
%doc
@ -141,71 +117,6 @@ fi
%changelog
* Mon Jan 30 2023 Link Dupont <link@redhat.com> - 3.1.7-12
- Conditionally run semanage only when SELinux is enabled (RHBZ#2150908)
* Fri Nov 11 2022 Alba Hita Catala <ahitacat@redhat.com> 0:3.1.7-11
- Set SELinux policy to permissive for rhcd_t module (RHBZ#2141444)
* Tue Nov 08 2022 Link Dupont <link@redhat.com> 0:3.1.7-10
- Include insights-core.egg as RPM source (RHBZ#2029395)
* Mon Sep 19 2022 Gael Chamoulaud <gchamoul@redhat.com> 3.1.7-9
- Add /var/cache/insights-client/ directory in files directives (RHBZ#2127962)
* Wed Apr 13 2022 Link Dupont <link@sub-pop.net> 0:3.1.7-8
- Ensure __python3 macro is globally set to platform-python (RHBZ#2069282)
* Thu Mar 31 2022 Gael Chamoulaud (Strider) <gchamoul@redhat.com> 0:3.1.7-7
- Add several insights /var directories in %files directives (RHBZ#2070588)
* Mon Mar 14 2022 Gael Chamoulaud (Strider) <gchamoul@redhat.com> 0:3.1.7-6
- Update patches
* Wed Feb 16 2022 Gaël Chamoulaud <gchamoul@redhat.com> - 3.1.7-5
- Add DROP-IN-RPM patches_ignore rule for rdopkg
* Wed Feb 16 2022 Gaël Chamoulaud <gchamoul@redhat.com> - 3.1.7-4
- Restore insights-client-boot.service preun/postun (RHBZ#2055036)
* Wed Feb 16 2022 Gaël Chamoulaud <gchamoul@redhat.com> - 3.1.7-3
- Remove scriptlets referencing nonexistent files (RHBZ#2055036)
* Thu Feb 10 2022 Gaël Chamoulaud <gchamoul@redhat.com> - 3.1.7-2
- Rename "http://cloud.redhat.com" to "https://console.redhat.com" (RHBZ#2052875)
- Clean superfluous %clean section - rpmlint error
* Wed Oct 20 2021 Link Dupont <link@redhat.com> - 3.1.7-1
- New upstream version (Resolves RHBZ#2013800)
- Disable client metrics collection
- Create fallback.json dynamically at build time
* Fri Jun 25 2021 Jeremy Crafts <jcrafts@redhat.com> - 3.1.5-1
- Fix metrics auth and connection issues (RHBZ#1966761)
- Disallow --offline and --unregister together (RHBZ#1920946)
- Do not modify motd if already set (RHBZ#1945481)
- Enable insights-client-boot service on install (RHBZ#1951750)
* Tue Apr 20 2021 Jeremy Crafts <jcrafts@redhat.com> - 3.1.2-1
- New upstream version
* 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)
@ -270,15 +181,6 @@ fi
* 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