From fbeb0c13bf1dc61aa20f02ed0e3f814645dafe57 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 7 Jun 2024 18:57:16 +0200 Subject: [PATCH 01/10] Rebuilt for Python 3.13 --- ec2-hibinit-agent.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ec2-hibinit-agent.spec b/ec2-hibinit-agent.spec index bcb529e..ddb1ee1 100644 --- a/ec2-hibinit-agent.spec +++ b/ec2-hibinit-agent.spec @@ -12,7 +12,7 @@ Name: ec2-hibinit-agent Version: 1.0.9 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Hibernation setup utility for Amazon EC2 License: Apache-2.0 @@ -144,6 +144,9 @@ fi %selinux_relabel_post -s %{selinuxtype} %changelog +* Fri Jun 07 2024 Python Maint - 1.0.9-2 +- Rebuilt for Python 3.13 + * Sun Jun 02 2024 Packit - 1.0.9-1 - Update to version 1.0.9 From de7514a8ee9998cd234ffce47d90c6b7b0ff7808 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 17 Jul 2024 21:40:34 +0000 Subject: [PATCH 02/10] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- ec2-hibinit-agent.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ec2-hibinit-agent.spec b/ec2-hibinit-agent.spec index ddb1ee1..026f627 100644 --- a/ec2-hibinit-agent.spec +++ b/ec2-hibinit-agent.spec @@ -12,7 +12,7 @@ Name: ec2-hibinit-agent Version: 1.0.9 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Hibernation setup utility for Amazon EC2 License: Apache-2.0 @@ -144,6 +144,9 @@ fi %selinux_relabel_post -s %{selinuxtype} %changelog +* Wed Jul 17 2024 Fedora Release Engineering - 1.0.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Fri Jun 07 2024 Python Maint - 1.0.9-2 - Rebuilt for Python 3.13 From c8eb6a5d671336d2d6c13e7040ccf045e2d93e95 Mon Sep 17 00:00:00 2001 From: Dominik Wombacher Date: Fri, 8 Nov 2024 09:22:19 +0000 Subject: [PATCH 03/10] fix: Ensure swapon with maximum priority before hibernation Refs: https://github.com/aws/amazon-ec2-hibinit-agent/pull/49 Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2322884 --- ...-maximum-priority-before-hibernation.patch | 54 +++++++++++++++++++ ec2-hibinit-agent.spec | 12 ++++- 2 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 0001-swapon-with-maximum-priority-before-hibernation.patch diff --git a/0001-swapon-with-maximum-priority-before-hibernation.patch b/0001-swapon-with-maximum-priority-before-hibernation.patch new file mode 100644 index 0000000..cba7e2f --- /dev/null +++ b/0001-swapon-with-maximum-priority-before-hibernation.patch @@ -0,0 +1,54 @@ +From f75434659a731ebdfc259990eb37777700900ea2 Mon Sep 17 00:00:00 2001 +From: Dominik Wombacher +Date: Thu, 7 Nov 2024 15:27:03 +0000 +Subject: [PATCH 1/1] fix(rhel): Swapon with maximum priority before + hibernation + +Apply swapon high priority related changes from /acpid.sleep.sh to /packaging/rhel/acpid.sleep.sh + +Refs: https://github.com/aws/amazon-ec2-hibinit-agent/commit/a2303d269610a6e7415c5045766da605eaa7e30f +--- + packaging/rhel/acpid.sleep.sh | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/packaging/rhel/acpid.sleep.sh b/packaging/rhel/acpid.sleep.sh +index ca3db22..9b381f9 100755 +--- a/packaging/rhel/acpid.sleep.sh ++++ b/packaging/rhel/acpid.sleep.sh +@@ -3,11 +3,14 @@ + PATH=/sbin:/bin:/usr/bin + failed='false' + ++# Hibernation selects the swapfile with highest priority. Since there may be ++# other swapfiles configured, ensure /swap is selected as hibernation ++# target by setting to maximum priority. ++swap_priority=32767 ++ + hibernate() + { +- swapon /swap +- systemctl hibernate +- ++ swapon --priority=$swap_priority /swap && systemctl hibernate + if [ $? -ne 0 ] + then + logger "Hibernation failed, Sleeping 2 mins before retry" +@@ -15,6 +18,7 @@ hibernate() + else + failed='false' + fi ++ swapoff /swap + } + + case "$2" in +@@ -26,6 +30,7 @@ case "$2" in + hibernate + if [ $failed == 'true' ]; + then ++ swapoff /swap + sleep 2m + else + break +-- +2.47.0 + diff --git a/ec2-hibinit-agent.spec b/ec2-hibinit-agent.spec index 026f627..876af8e 100644 --- a/ec2-hibinit-agent.spec +++ b/ec2-hibinit-agent.spec @@ -12,13 +12,17 @@ Name: ec2-hibinit-agent Version: 1.0.9 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Hibernation setup utility for Amazon EC2 License: Apache-2.0 URL: https://github.com/aws/amazon-%{name} Source0: https://github.com/aws/%{project}/archive/v%{version}/%{name}-%{version}.tar.gz +# Ensure swapon with maximum priority before hibernation +# Upstream Patch: https://github.com/aws/amazon-ec2-hibinit-agent/pull/49) +Patch1: 0001-swapon-with-maximum-priority-before-hibernation.patch + BuildArch: noarch BuildRequires: make @@ -38,7 +42,7 @@ Requires: tuned An EC2 agent that creates a setup for instance hibernation %prep -%autosetup -n %{project}-%{version} +%autosetup -p1 -n %{project}-%{version} # Fix build with setuptools 62.1 # https://github.com/aws/amazon-ec2-hibinit-agent/issues/24 sed -i "20i packages=[]," setup.py @@ -144,6 +148,10 @@ fi %selinux_relabel_post -s %{selinuxtype} %changelog +* Fri Nov 08 2024 Dominik Wombacher - 1.0.9-4 +- Include upstream Patch to ensure swapon with maximum priority before hibernation +- Resolves rhbz#2322884 + * Wed Jul 17 2024 Fedora Release Engineering - 1.0.9-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 8faa7d0264ce6952a00903dfc306885e80dfdeac Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jan 2025 16:35:05 +0000 Subject: [PATCH 04/10] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- ec2-hibinit-agent.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ec2-hibinit-agent.spec b/ec2-hibinit-agent.spec index 876af8e..fd95562 100644 --- a/ec2-hibinit-agent.spec +++ b/ec2-hibinit-agent.spec @@ -12,7 +12,7 @@ Name: ec2-hibinit-agent Version: 1.0.9 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Hibernation setup utility for Amazon EC2 License: Apache-2.0 @@ -148,6 +148,9 @@ fi %selinux_relabel_post -s %{selinuxtype} %changelog +* Thu Jan 16 2025 Fedora Release Engineering - 1.0.9-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Fri Nov 08 2024 Dominik Wombacher - 1.0.9-4 - Include upstream Patch to ensure swapon with maximum priority before hibernation - Resolves rhbz#2322884 From 8d3ba6125a5bda8200a5569cd5267a901d90b74e Mon Sep 17 00:00:00 2001 From: Frank Liang Date: Tue, 18 Mar 2025 09:37:33 +0800 Subject: [PATCH 05/10] fix swapoff breaks hibernate process Refs: https://github.com/aws/amazon-ec2-hibinit-agent/pull/50 Signed-off-by: Frank Liang (cherry picked from commit 2ebeb61bbb6573874a24df7568d2f4c70c6e376a) --- ...fix-swapoff-breaks-hibernate-process.patch | 59 +++++++++++++++++++ ec2-hibinit-agent.spec | 6 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 0002-rhel-fix-swapoff-breaks-hibernate-process.patch diff --git a/0002-rhel-fix-swapoff-breaks-hibernate-process.patch b/0002-rhel-fix-swapoff-breaks-hibernate-process.patch new file mode 100644 index 0000000..06c042e --- /dev/null +++ b/0002-rhel-fix-swapoff-breaks-hibernate-process.patch @@ -0,0 +1,59 @@ +From 0197c7173a5ad1470060862a0be96b9a976bdf49 Mon Sep 17 00:00:00 2001 +From: Frank Liang +Date: Thu, 2 Jan 2025 22:28:12 +0800 +Subject: [PATCH] rhel: fix swapoff breaks hibernate process + +hibernate() always calling swapoff breaks hibernation process. +The hibernation wont continue if call swapoff too fast in rhel or amazon +linux. + +"swapon --priority=32767 /swap && systemctl hibernate ;echo $?; swapoff /swap" + +Signed-off-by: Frank Liang +--- + packaging/rhel/acpid.sleep.sh | 17 ++++++----------- + 1 file changed, 6 insertions(+), 11 deletions(-) + +diff --git a/packaging/rhel/acpid.sleep.sh b/packaging/rhel/acpid.sleep.sh +index 9b381f9..1e55b51 100755 +--- a/packaging/rhel/acpid.sleep.sh ++++ b/packaging/rhel/acpid.sleep.sh +@@ -11,29 +11,24 @@ swap_priority=32767 + hibernate() + { + swapon --priority=$swap_priority /swap && systemctl hibernate +- if [ $? -ne 0 ] +- then ++ if [ $? -ne 0 ]; then + logger "Hibernation failed, Sleeping 2 mins before retry" + failed='true' ++ swapoff /swap ++ sleep 2m + else + failed='false' + fi +- swapoff /swap + } + + case "$2" in + SBTN) + # The iteration had been placed here to add retry logic to hibernation + # in case of failures and to avoid force stop of instances after 20min +- for i in 1 2 3 +- do ++ for i in 1 2 3; do + hibernate +- if [ $failed == 'true' ]; +- then +- swapoff /swap +- sleep 2m +- else +- break ++ if [ $failed == 'false' ]; then ++ break + fi + done + ;; +-- +2.48.1 + diff --git a/ec2-hibinit-agent.spec b/ec2-hibinit-agent.spec index fd95562..1d38962 100644 --- a/ec2-hibinit-agent.spec +++ b/ec2-hibinit-agent.spec @@ -12,7 +12,7 @@ Name: ec2-hibinit-agent Version: 1.0.9 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Hibernation setup utility for Amazon EC2 License: Apache-2.0 @@ -22,6 +22,7 @@ Source0: https://github.com/aws/%{project}/archive/v%{version}/%{name}-%{ # Ensure swapon with maximum priority before hibernation # Upstream Patch: https://github.com/aws/amazon-ec2-hibinit-agent/pull/49) Patch1: 0001-swapon-with-maximum-priority-before-hibernation.patch +Patch2: 0002-rhel-fix-swapoff-breaks-hibernate-process.patch BuildArch: noarch @@ -148,6 +149,9 @@ fi %selinux_relabel_post -s %{selinuxtype} %changelog +* Tue Mar 18 2025 Frank Liang - 1.0.9-6 +- Include upstream Patch to fix swapoff breaks hibernate process + * Thu Jan 16 2025 Fedora Release Engineering - 1.0.9-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From b01e3c9b651437ade275ad10e81506c5f4c6e195 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Tue, 3 Jun 2025 12:20:16 +0200 Subject: [PATCH 06/10] Rebuilt for Python 3.14 --- ec2-hibinit-agent.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ec2-hibinit-agent.spec b/ec2-hibinit-agent.spec index 1d38962..c26867c 100644 --- a/ec2-hibinit-agent.spec +++ b/ec2-hibinit-agent.spec @@ -12,7 +12,7 @@ Name: ec2-hibinit-agent Version: 1.0.9 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Hibernation setup utility for Amazon EC2 License: Apache-2.0 @@ -149,6 +149,9 @@ fi %selinux_relabel_post -s %{selinuxtype} %changelog +* Tue Jun 03 2025 Python Maint - 1.0.9-7 +- Rebuilt for Python 3.14 + * Tue Mar 18 2025 Frank Liang - 1.0.9-6 - Include upstream Patch to fix swapoff breaks hibernate process From 907cf67e48e5e8841e253f02bd71556fd8680e75 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 23 Jul 2025 19:41:21 +0000 Subject: [PATCH 07/10] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- ec2-hibinit-agent.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ec2-hibinit-agent.spec b/ec2-hibinit-agent.spec index c26867c..9defa5e 100644 --- a/ec2-hibinit-agent.spec +++ b/ec2-hibinit-agent.spec @@ -12,7 +12,7 @@ Name: ec2-hibinit-agent Version: 1.0.9 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Hibernation setup utility for Amazon EC2 License: Apache-2.0 @@ -149,6 +149,9 @@ fi %selinux_relabel_post -s %{selinuxtype} %changelog +* Wed Jul 23 2025 Fedora Release Engineering - 1.0.9-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Tue Jun 03 2025 Python Maint - 1.0.9-7 - Rebuilt for Python 3.14 From 0c339f8028da2e49b85c2ab3327f91dbead74230 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 16 Jan 2026 10:24:44 +0000 Subject: [PATCH 08/10] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild --- ec2-hibinit-agent.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ec2-hibinit-agent.spec b/ec2-hibinit-agent.spec index 9defa5e..a092799 100644 --- a/ec2-hibinit-agent.spec +++ b/ec2-hibinit-agent.spec @@ -12,7 +12,7 @@ Name: ec2-hibinit-agent Version: 1.0.9 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Hibernation setup utility for Amazon EC2 License: Apache-2.0 @@ -149,6 +149,9 @@ fi %selinux_relabel_post -s %{selinuxtype} %changelog +* Fri Jan 16 2026 Fedora Release Engineering - 1.0.9-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + * Wed Jul 23 2025 Fedora Release Engineering - 1.0.9-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 8ce7c2eb08caaab1020bc3a7bd36fc65f30e405a Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 5 Jun 2026 00:03:53 +0200 Subject: [PATCH 09/10] Rebuilt for Python 3.15 --- ec2-hibinit-agent.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ec2-hibinit-agent.spec b/ec2-hibinit-agent.spec index a092799..b8ab8b2 100644 --- a/ec2-hibinit-agent.spec +++ b/ec2-hibinit-agent.spec @@ -12,7 +12,7 @@ Name: ec2-hibinit-agent Version: 1.0.9 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Hibernation setup utility for Amazon EC2 License: Apache-2.0 @@ -149,6 +149,9 @@ fi %selinux_relabel_post -s %{selinuxtype} %changelog +* Thu Jun 04 2026 Python Maint - 1.0.9-10 +- Rebuilt for Python 3.15 + * Fri Jan 16 2026 Fedora Release Engineering - 1.0.9-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From cc780d207a5d498d28fd2b12e37623ff50d1743f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 15 Jul 2026 22:12:13 +0000 Subject: [PATCH 10/10] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild --- ec2-hibinit-agent.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ec2-hibinit-agent.spec b/ec2-hibinit-agent.spec index b8ab8b2..7a8c334 100644 --- a/ec2-hibinit-agent.spec +++ b/ec2-hibinit-agent.spec @@ -12,7 +12,7 @@ Name: ec2-hibinit-agent Version: 1.0.9 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Hibernation setup utility for Amazon EC2 License: Apache-2.0 @@ -149,6 +149,9 @@ fi %selinux_relabel_post -s %{selinuxtype} %changelog +* Wed Jul 15 2026 Fedora Release Engineering - 1.0.9-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + * Thu Jun 04 2026 Python Maint - 1.0.9-10 - Rebuilt for Python 3.15