Compare commits

...

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

7 changed files with 137 additions and 5 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
SOURCES/v0.14.0.tar.gz
SOURCES/greenboot-0.15.1.tar.gz
/greenboot-0.15.1.tar.gz

View File

@ -1 +0,0 @@
6c94c4e8961505c4b704248f77ed76f20892cd4d SOURCES/v0.14.0.tar.gz

View File

@ -0,0 +1,46 @@
From 2c0ac48ec6fd620816da4e240d9a2310922786d6 Mon Sep 17 00:00:00 2001
From: Antonio Murdaca <runcom@linux.com>
Date: Thu, 8 Sep 2022 14:20:30 +0200
Subject: [PATCH] avoid running checks if conditions aren't met
Signed-off-by: Antonio Murdaca <runcom@linux.com>
---
.../greenboot/check/required.d/01_repository_dns_check.sh | 5 +++++
usr/lib/greenboot/check/required.d/02_watchdog.sh | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/usr/lib/greenboot/check/required.d/01_repository_dns_check.sh b/usr/lib/greenboot/check/required.d/01_repository_dns_check.sh
index f661dcd..51e52b3 100644
--- a/usr/lib/greenboot/check/required.d/01_repository_dns_check.sh
+++ b/usr/lib/greenboot/check/required.d/01_repository_dns_check.sh
@@ -44,6 +44,11 @@ if [[ ! -d $REPOS_DIRECTORY ]]; then
exit 1
fi
+if [ -z "$(ls -A $REPOS_DIRECTORY)" ]; then
+ echo "${REPOS_DIRECTORY} is empty, skipping check"
+ exit 0
+fi
+
get_domain_names_from_platform_urls
if [[ -n $DOMAIN_NAMES ]]; then
get_dns_resolution_from_domain_names
diff --git a/usr/lib/greenboot/check/required.d/02_watchdog.sh b/usr/lib/greenboot/check/required.d/02_watchdog.sh
index 101750d..b072288 100644
--- a/usr/lib/greenboot/check/required.d/02_watchdog.sh
+++ b/usr/lib/greenboot/check/required.d/02_watchdog.sh
@@ -41,6 +41,11 @@ check_if_current_boot_is_wd_triggered() {
fi
}
+if ! check_if_there_is_a_watchdog ; then
+ echo "No watchdog on the system, skipping check"
+ exit 0
+fi
+
# This is in order to test check_if_current_boot_is_wd_triggered
# function within a container
if [ "${1}" != "--source-only" ]; then
--
2.37.3

View File

@ -0,0 +1,56 @@
From 483cff9b89abc30f218f223bef98704639bd08e7 Mon Sep 17 00:00:00 2001
From: Sayan Paul <saypaul@redhat.com>
Date: Mon, 29 Aug 2022 22:33:06 +0530
Subject: [PATCH] disable DefaultDependencies to fix cycle error
The fix relaxes the dependecies of task-runner and status service that
otherwise causes issue in the service to start as well as missing
logs
signed off: saypaul@fedoraproject.org
---
usr/lib/systemd/system/greenboot-grub2-set-success.service | 2 ++
usr/lib/systemd/system/greenboot-status.service | 1 +
usr/lib/systemd/system/greenboot-task-runner.service | 2 ++
3 files changed, 5 insertions(+)
diff --git a/usr/lib/systemd/system/greenboot-grub2-set-success.service b/usr/lib/systemd/system/greenboot-grub2-set-success.service
index f5ef55a..87a7a61 100644
--- a/usr/lib/systemd/system/greenboot-grub2-set-success.service
+++ b/usr/lib/systemd/system/greenboot-grub2-set-success.service
@@ -11,6 +11,8 @@
Description=Mark boot as successful in grubenv
Requires=boot-complete.target
After=boot-complete.target
+Conflicts=redboot.target
+DefaultDependencies=no
[Service]
Type=oneshot
diff --git a/usr/lib/systemd/system/greenboot-status.service b/usr/lib/systemd/system/greenboot-status.service
index b12ec2f..f52c183 100644
--- a/usr/lib/systemd/system/greenboot-status.service
+++ b/usr/lib/systemd/system/greenboot-status.service
@@ -12,6 +12,7 @@ Description=greenboot MotD Generator
After=greenboot-healthcheck.service
After=greenboot-task-runner.service
After=redboot-task-runner.service
+DefaultDependencies=no
[Service]
Type=oneshot
diff --git a/usr/lib/systemd/system/greenboot-task-runner.service b/usr/lib/systemd/system/greenboot-task-runner.service
index d1fc07f..bf5e94b 100644
--- a/usr/lib/systemd/system/greenboot-task-runner.service
+++ b/usr/lib/systemd/system/greenboot-task-runner.service
@@ -11,6 +11,8 @@
Description=greenboot Success Scripts Runner
Requires=boot-complete.target
After=boot-complete.target
+Conflicts=redboot.target
+DefaultDependencies=no
[Service]
Type=oneshot
--
2.37.2

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -1,7 +1,7 @@
%global debug_package %{nil}
Name: greenboot
Version: 0.14.0
Version: 0.15.1
Release: 3%{?dist}
Summary: Generic Health Check Framework for systemd
License: LGPLv2+
@ -11,7 +11,9 @@ License: LGPLv2+
%global repo_tag v%{version}
URL: https://github.com/%{repo_owner}/%{repo_name}
Source0: https://github.com/%{repo_owner}/%{repo_name}/archive/%{repo_tag}.tar.gz
Source0: https://github.com/%{repo_owner}/%{repo_name}/archive/%{repo_tag}.tar.g#/%{name}-%{version}.tar.gz
Patch0: 0001-disable-DefaultDependencies-to-fix-cycle-error.patch
Patch1: 0001-avoid-running-checks-if-conditions-aren-t-met.patch
ExcludeArch: s390x
BuildRequires: systemd-rpm-macros
@ -50,7 +52,7 @@ Obsoletes: greenboot-update-platforms-check <= 0.12.0
%{summary}.
%prep
%setup -q
%autosetup -p1
%build
@ -76,6 +78,7 @@ install -DpZm 0644 usr/lib/systemd/system/*.service %{buildroot}%{_unitdir}
install -DpZm 0644 usr/lib/tmpfiles.d/greenboot-status-motd.conf %{buildroot}%{_tmpfilesdir}/greenboot-status-motd.conf
install -DpZm 0755 usr/lib/greenboot/check/required.d/* %{buildroot}%{_prefix}/lib/%{name}/check/required.d
install -DpZm 0755 usr/lib/greenboot/check/wanted.d/* %{buildroot}%{_prefix}/lib/%{name}/check/wanted.d
install -DpZm 0644 etc/greenboot/greenboot.conf %{buildroot}%{_sysconfdir}/%{name}/greenboot.conf
%post
%systemd_post greenboot-healthcheck.service
@ -88,6 +91,7 @@ install -DpZm 0755 usr/lib/greenboot/check/wanted.d/* %{buildroot}%{_prefix}/lib
%systemd_post greenboot-grub2-set-success.service
%systemd_post greenboot-rpm-ostree-grub2-check-fallback.service
%systemd_post redboot-auto-reboot.service
%systemd_post greenboot-service-monitor.service
%post default-health-checks
%systemd_post greenboot-loading-message.service
@ -102,6 +106,7 @@ install -DpZm 0755 usr/lib/greenboot/check/wanted.d/* %{buildroot}%{_prefix}/lib
%systemd_preun greenboot-grub2-set-counter.service
%systemd_preun greenboot-grub2-set-success.service
%systemd_preun greenboot-rpm-ostree-grub2-check-fallback.service
%systemd_preun greenboot-service-monitor.service
%preun default-health-checks
%systemd_preun greenboot-loading-message.service
@ -116,6 +121,7 @@ install -DpZm 0755 usr/lib/greenboot/check/wanted.d/* %{buildroot}%{_prefix}/lib
%systemd_postun greenboot-grub2-set-counter.service
%systemd_postun greenboot-grub2-set-success.service
%systemd_postun greenboot-rpm-ostree-grub2-check-fallback.service
%systemd_postun greenboot-service-monitor.service
%postun default-health-checks
%systemd_postun greenboot-loading-message.service
@ -156,6 +162,9 @@ install -DpZm 0755 usr/lib/greenboot/check/wanted.d/* %{buildroot}%{_prefix}/lib
%{_unitdir}/greenboot-rpm-ostree-grub2-check-fallback.service
%{_libexecdir}/%{name}/redboot-auto-reboot
%{_unitdir}/redboot-auto-reboot.service
%{_libexecdir}/%{name}/greenboot-service-monitor
%{_unitdir}/greenboot-service-monitor.service
%{_sysconfdir}/%{name}/greenboot.conf
%files default-health-checks
%{_prefix}/lib/%{name}/check/required.d/01_repository_dns_check.sh
@ -164,6 +173,20 @@ install -DpZm 0755 usr/lib/greenboot/check/wanted.d/* %{buildroot}%{_prefix}/lib
%{_prefix}/lib/%{name}/check/required.d/02_watchdog.sh
%changelog
* Thu Sep 08 2022 Peter Robinson <pbrobinson@fedoraproject.org> - 0.15.1-3
- Avoid running health checks if conditions aren't met
* Wed Aug 31 2022 Peter Robinson <pbrobinson@fedoraproject.org> - 0.15.1-2
- disable DefaultDependencies to fix cycle error
* Tue Aug 09 2022 Peter Robinson <pbrobinson@fedoraproject.org> - 0.15.1-1
- Add conf during installation
* Thu Jul 21 2022 Sayan Paul <saypaul@fedoraproject.org> - 0.15.0-1
- The 0.15.0 release
- Add service-monitor
- Resolves: rhbz#2053469
* Tue Jan 18 2022 Peter Robinson <pbrobinson@fedoraproject.org> - 0.14.0-3
- Obsolete greenboot-status

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (greenboot-0.15.1.tar.gz) = 756dd5840ead975082f20defb83489a75b4a3370eaf43a9aa6b7b4dad925597ddf5518e2a0566d1545189bf2e31d2200e626a602433b6a5f5a0d2cb5511dd6d8