Compare commits

...
Sign in to create a new pull request.

30 commits

Author SHA1 Message Date
Fedora Release Engineering
907cf67e48 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-23 19:41:21 +00:00
Python Maint
b01e3c9b65 Rebuilt for Python 3.14 2025-06-03 12:20:16 +02:00
Frank Liang
8d3ba6125a fix swapoff breaks hibernate process
Refs: https://github.com/aws/amazon-ec2-hibinit-agent/pull/50

Signed-off-by: Frank Liang <xiliang@redhat.com>

(cherry picked from commit 2ebeb61bbb)
2025-03-20 10:34:54 +00:00
Fedora Release Engineering
8faa7d0264 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-16 16:35:05 +00:00
Dominik Wombacher
c8eb6a5d67 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
2024-11-08 09:22:19 +00:00
Fedora Release Engineering
de7514a8ee Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-17 21:40:34 +00:00
Python Maint
fbeb0c13bf Rebuilt for Python 3.13 2024-06-07 18:57:16 +02:00
Packit
c6fb8d2397 Update to 1.0.9 upstream release
Upstream tag: v1.0.9
Upstream commit: 527a5f69

Commit authored by Packit automation (https://packit.dev/)
2024-06-02 10:04:57 +00:00
Dominik Wombacher
32c76d1f5c fix(Packit): Set 'upstream_tag_template' because of 'ERROR Cannot checkout release tag.' in latest Packit Job. 2024-06-02 10:03:10 +00:00
Dominik Wombacher
f2bc9f24ee feat: Packit onboarding 2024-05-06 12:56:06 +00:00
Dominik Wombacher
ff1a7e4386 feat: Update to 1.0.8 and migrated to SPDX
v1.0.8, Graceful Termination Improvements
- Critical termination protection

v1.0.7, Btrfs Support for hibernation
- Change message when removing SWAP
- Adding btrfs-enabled to set No_COW and get offset using btrfs

v1.0.6
- Add initial Amazon Linux 2022 support
- Add pm-utils for required package
- Recreating the swap file if the current size is sufficiently larger
- Update /sys/power/resume_offset and /sys/power/resume only if present
2024-04-08 09:42:45 +00:00
Fedora Release Engineering
0bbca160b0 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-24 10:05:40 +00:00
Fedora Release Engineering
2f29b08b09 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-19 17:48:58 +00:00
Fedora Release Engineering
3c56a0a305 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-19 18:10:50 +00:00
Python Maint
fa6acbbc3f Rebuilt for Python 3.12 2023-06-14 23:08:00 +02:00
David Duncan
d6db7d683d 1.0.5 2023-04-25 01:04:20 -05:00
David Duncan
1aecb6782a bump: update package to 1.0.5 version of the agent
Description of changes:

With recent versions of systemd, if your system has an additional or multiple swapfiles configured,
then swapon adds a swapfile to the system with the next lowest priority. The issue with this is,
the system will hibernate to the swapfile with the highest priority. In this case, /swapfile is -2,
the highest of any of the swapfiles. Hibernation will fail, due to only /swap-hibinit being correctly
set up on the kernel command line with resume= and resume_offset=. The result is that the EC2 console
says "Stopping" for 20 minutes, and then force stops the instance at the 20 minute timeout.

Fix this by ensuring we swapon the hibinit swapfile with the highest priority, 32767, which will be
higher than any manually created swapfiles.

 # The commit type can include the following:

 #: feat – a new feature is introduced with the changes
 #: fix – a bug fix has occurred
 #: chore – changes that do not relate to a fix or feature and don't modify src or test files (for example updating dependencies)
 #: refactor – refactored code that neither fixes a bug nor adds a feature
 #: docs – updates to documentation such as a the README or other markdown files
 #: style – changes that do not affect the meaning of the code, likely related to code formatting such as white-space, missing semi-colons, and so on.
 #: test – including new or correcting previous tests
 #: perf – performance improvements
 #: ci – continuous integration related
 #: build – changes that affect the build system or external dependencies
 #: revert – reverts a previous commit
2023-04-25 00:50:25 -05:00
Fedora Release Engineering
3fee0c6dd8 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 02:03:29 +00:00
Fedora Release Engineering
94af61e75e Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 01:34:29 +00:00
Lumir Balhar
2ac0452c81 Fix compatibility with newer setuptools 2022-06-21 12:47:35 +02:00
Python Maint
6a90344d05 Rebuilt for Python 3.11 2022-06-15 18:15:34 +02:00
Fedora Release Engineering
5c8d5ea989 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 01:35:12 +00:00
Fedora Release Engineering
b4fa8b4a9d - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 21:36:02 +00:00
David Duncan
69f551d20c Update to v1.0.4 from upstream repository 2021-07-01 03:17:13 +00:00
Python Maint
b8bd3c1a4d Rebuilt for Python 3.10 2021-06-05 09:41:37 +02:00
Python Maint
66ab0dd737 Rebuilt for Python 3.10 2021-06-04 20:03:38 +02:00
Tomas Hrnciar
11a9096fa9 BuildRequire setuptools explicitly
See https://fedoraproject.org/wiki/Changes/Reduce_dependencies_on_python3-setuptools
2021-04-19 13:18:31 +02:00
Zbigniew Jędrzejewski-Szmek
d19024073e Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.
2021-03-02 16:13:53 +01:00
Fedora Release Engineering
72da59641f - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 04:14:27 +00:00
David Duncan
6414274ece Update spec to reflect updates https://github.com/tstellar/fedora-change-make-buildroot 2021-01-21 17:29:02 +00:00
7 changed files with 259 additions and 5 deletions

6
.gitignore vendored
View file

@ -1 +1,7 @@
/ec2-hibinit-agent-1.0.3.tar.gz
/ec2-hibinit-agent-1.0.4.tar.gz
*.~undo-tree~
amazon-ec2-hibinit-agent.spec
/ec2-hibinit-agent-1.0.5.tar.gz
/ec2-hibinit-agent-1.0.8.tar.gz
/ec2-hibinit-agent-1.0.9.tar.gz

42
.packit.yaml Normal file
View file

@ -0,0 +1,42 @@
# See the documentation for more information:
# https://packit.dev/docs/configuration/
upstream_project_url: https://github.com/aws/amazon-ec2-hibinit-agent
upstream_tag_template: v{version}
upstream_package_name: amazon-ec2-hibinit-agent
downstream_package_name: ec2-hibinit-agent
jobs:
- job: pull_from_upstream
trigger: release
# Keeping dist-git branches non-divergent
# Requirs manual local merge from rawhide to stable release branches
# https://packit.dev/docs/fedora-releases-guide#keeping-dist-git-branches-non-divergent
dist_git_branches:
- fedora-rawhide
- job: koji_build
trigger: commit
allowed_pr_authors:
- packit
- all_admins
- all_committers
- '@cloud-sig' # string with @ needs quotes to be valid yaml
allowed_committers:
- all_admins
- all_committers
- '@cloud-sig' # string with @ needs quotes to be valid yaml
dist_git_branches:
- fedora-all
- epel-all
- job: bodhi_update
trigger: commit
allowed_builders:
- packit
- all_admins
- all_committers
- '@cloud-sig' # string with @ needs quotes to be valid yaml
dist_git_branches:
- fedora-branched # rawhide updates are created automatically
- epel-all

View file

@ -0,0 +1,54 @@
From f75434659a731ebdfc259990eb37777700900ea2 Mon Sep 17 00:00:00 2001
From: Dominik Wombacher <dominik@wombacher.cc>
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

View file

@ -0,0 +1,59 @@
From 0197c7173a5ad1470060862a0be96b9a976bdf49 Mon Sep 17 00:00:00 2001
From: Frank Liang <xiliang@redhat.com>
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 <xiliang@redhat.com>
---
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

3
README.packit Normal file
View file

@ -0,0 +1,3 @@
This repository is maintained by packit.
https://packit.dev/
The file was generated using packit 0.97.1.post1.dev4+g1268842e.

View file

@ -11,19 +11,25 @@
%global _format() export %1=""; for x in %{modulenames}; do %1+=%2; %1+=" "; done;
Name: ec2-hibinit-agent
Version: 1.0.3
Release: 3%{?dist}
Version: 1.0.9
Release: 8%{?dist}
Summary: Hibernation setup utility for Amazon EC2
License: ASL 2.0
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
Patch2: 0002-rhel-fix-swapoff-breaks-hibernate-process.patch
BuildArch: noarch
BuildRequires: make
BuildRequires: systemd-rpm-macros
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: selinux-policy
BuildRequires: selinux-policy-devel
@ -37,7 +43,10 @@ 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
%build
%py3_build
@ -140,6 +149,87 @@ fi
%selinux_relabel_post -s %{selinuxtype}
%changelog
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.9-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Tue Jun 03 2025 Python Maint <python-maint@redhat.com> - 1.0.9-7
- Rebuilt for Python 3.14
* Tue Mar 18 2025 Frank Liang <xiliang@redhat.com> - 1.0.9-6
- Include upstream Patch to fix swapoff breaks hibernate process
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.9-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Fri Nov 08 2024 Dominik Wombacher <dominik@wombacher.cc> - 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 <releng@fedoraproject.org> - 1.0.9-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 1.0.9-2
- Rebuilt for Python 3.13
* Sun Jun 02 2024 Packit <hello@packit.dev> - 1.0.9-1
- Update to version 1.0.9
* Mon Apr 8 2024 Dominik Wombacher <dominik@wombacher.cc> - 1.0.8-1
- Update to 1.0.8
- migrated to SPDX license
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jun 14 2023 Python Maint <python-maint@redhat.com> - 1.0.5-2
- Rebuilt for Python 3.12
* Tue Apr 25 2023 David Duncan <<davdunc@amazon.com>> - 1.0.5-1
- Ensure we swapon the hibinit swapfile with the highest priority
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Tue Jun 21 2022 Lumír Balhar <lbalhar@redhat.com> - 1.0.4-5
- Fix compatibility with newer setuptools
* Wed Jun 15 2022 Python Maint <python-maint@redhat.com> - 1.0.4-4
- Rebuilt for Python 3.11
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Jul 01 2021 David Duncan <davdunc@amazon.com> - 1.0.4-1
- Update to v1.0.4
* Sat Jun 05 2021 Python Maint <python-maint@redhat.com> - 1.0.3-8
- Rebuilt for Python 3.10
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.0.3-7
- Rebuilt for Python 3.10
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.0.3-6
- Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Jan 21 17:27:18 UTC 2021 David Duncan <davdunc@amazon.com> - 1.0.3-4
- Add BuildRequires: make, FESCo issue: #2500
* Tue Nov 03 2020 Mohamed Aboubakr <mabouba@amazon.com> - 1.0.3-3
- Moving selinux folder in packaging directory.
- Use make file to generate .pp.bz2 file

View file

@ -1 +1 @@
SHA512 (ec2-hibinit-agent-1.0.3.tar.gz) = 5a44fdde6cb95c6a989f47b6b69d8611a114e02dbc44ea2421587662b75d6dd9b7e922cc4cf8976d76ed78e3c1bcd3a1e12254e90d31d5c3cf3357b49abd1236
SHA512 (ec2-hibinit-agent-1.0.9.tar.gz) = a056f3cf19775f1dca2079bf810d3a73cb0ddd4ad9de585e5878b5061683fc271577c02cf85a4332510f9e958bc84180a0a559a2f3f5de6c215002336b31f155