Skip to content

Commit

Permalink
Restart service on upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-lefebvre committed Jan 25, 2020
1 parent 9d9bca5 commit 5707b7b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion agent/hibinit-agent
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def create_state_dir(state_dir):
def hibernation_enabled(state_dir):
"""Returns a boolean indicating whether hibernation is enabled or not.
Hibernation can't be enabled/disabled the instance launch. If we find
Hibernation can't be enabled/disabled after the instance launch. If we find
hibernation to be enabled, we create a semephore file so that we don't
have to probe IMDS again. That is useful when a instance is rebooted
after/if the IMDS http endpoint has been disabled.
Expand Down
7 changes: 5 additions & 2 deletions ec2-hibinit-agent.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: ec2-hibinit-agent
Version: 1.0.1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Hibernation setup utility for AWS EC2

Group: System Environment/Daemons
Expand Down Expand Up @@ -55,9 +55,12 @@ rm -rf $RPM_BUILD_ROOT
%systemd_preun hibinit-agent.service

%postun
%systemd_postun hibinit-agent.service
%systemd_postun_with_restart hibinit-agent.service

%changelog
* Fri Jan 24 2020 Frederick Lefebvre <fredlef@amazon.com> - 1.0.1-2
- Restart the hibinit-agent service on upgrade

* Thu Jan 23 2020 Frederick Lefebvre <fredlef@amazon.com> - 1.0.1-1
- Added IMDSv2 support
- Renamed spec file to match the actual package name
Expand Down

0 comments on commit 5707b7b

Please sign in to comment.