Hibinit-agent starts even when instance hibernation is disabled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ec2-hibinit-agent (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Trusty |
Won't Fix
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* The preinstalled ec2-hibinit-agent package may prepare the instance for hibernation even when hibernation is disabled. This preparation includes setting up a swap file bigger or the same size as than the instance's RAM which is wasted if it is not used for hibernation.
* The fix is checking urlopen()'s return value against both 'false' and b'false', not just against 'false' that worked with Python 2.
[Test Case]
0. Start a c4 instance from a public image, e.g. ubuntu/
1. Verify that hibernation is disabled:
$ curl http://
false
2. Install ec2-hibinit-agent if it is not installed already
3. Verify that it does not start:
$ service hibinit-agent status
● hibinit-
Loaded: loaded (/lib/systemd/
Active: inactive (dead) since Wed 2019-02-27 15:28:47 UTC; 54s ago
Docs: file:/usr/
Process: 26448 ExecStart=
Main PID: 25259 (code=exited, status=0/SUCCESS)
Feb 27 15:28:46 ip-172-31-3-157 systemd[1]: Starting EC2 instance hibernation setup agent...
Feb 27 15:28:47 ip-172-31-3-157 /hibinit-
Feb 27 15:28:47 ip-172-31-3-157 hibinit-
Feb 27 15:28:47 ip-172-31-3-157 systemd[1]: Started EC2 instance hibernation setup agent.
4. Start a c4 instance from an encrypted EBS-backed AMI, with hibernation enabled.
5. Verify that hibernation is enabled:
$ curl http://
true
6. Install ec2-hibinit-agent if it is not installed already
7. Verify that it does start:
$ service hibinit-agent status
● hibinit-
Loaded: loaded (/lib/systemd/
Active: inactive (dead) since Wed 2019-02-27 12:50:26 UTC; 2h 30min ago
Docs: file:/usr/
Main PID: 25259 (code=exited, status=0/SUCCESS)
Feb 27 12:50:25 ip-172-31-3-157 hibinit-
Feb 27 12:50:25 ip-172-31-3-157 hibinit-
Feb 27 12:50:25 ip-172-31-3-157 hibinit-
Feb 27 12:50:25 ip-172-31-3-157 hibinit-
Feb 27 12:50:25 ip-172-31-3-157 hibinit-
Feb 27 12:50:25 ip-172-31-3-157 hibinit-
Feb 27 12:50:25 ip-172-31-3-157 hibinit-
Feb 27 12:50:25 ip-172-31-3-157 hibinit-
Feb 27 12:50:25 ip-172-31-3-157 hibinit-
Feb 27 12:50:25 ip-172-31-3-157 hibinit-
8. Start a c4 instance from an encrypted EBS-backed AMI, with hibernation disabled.
9. Verify that hibernation is disabled:
$ curl http://
<?xml version="1.0" encoding=
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://
<html xmlns="http://
<head>
<title>404 - Not Found</title>
</head>
<body>
<h1>404 - Not Found</h1>
</body>
</html>
10. Install ec2-hibinit-agent if it is not installed already
11. Verify that it does not start:
$ service hibinit-agent status
● hibinit-
Loaded: loaded (/lib/systemd/
Active: inactive (dead) since Wed 2019-02-27 15:28:47 UTC; 54s ago
Docs: file:/usr/
Process: 26448 ExecStart=
Main PID: 25259 (code=exited, status=0/SUCCESS)
Feb 27 15:28:46 ip-172-31-3-157 systemd[1]: Starting EC2 instance hibernation setup agent...
Feb 27 15:28:47 ip-172-31-3-157 /hibinit-
Feb 27 15:28:47 ip-172-31-3-157 hibinit-
Feb 27 15:28:47 ip-172-31-3-157 systemd[1]: Started EC2 instance hibernation setup agent.
[Regression Potential]
* As a side-effect of the fix hibinit-agent may fail to start when hibernation is enabled but the verification steps include this test case to avoid introducing the regression.
[Other Info]
* Some kernels may not resume from hibernation reliably. The Trusty AMI runs the generic kernel by default, but it could not resume from hibernation while testing the package. Please use the linux-aws kernel on Trusty when verifying this bug.
tags: | added: id-5c0aeca25b782a520d7ab037 |
tags: | added: id-5c000da0aa62bc2994611bd2 |
description: | updated |
This bug was fixed in the package ec2-hibinit-agent - 1.0.0-0ubuntu2
---------------
ec2-hibinit-agent (1.0.0-0ubuntu2) disco; urgency=medium
* debian/gbp.conf: Use ubuntu/ prefix for tags
* Silence swapoff when purging the package
* Detect disabled hibernation with Python 3's urllib, too. (LP: #1817926)
-- Balint Reczey <email address hidden> Wed, 27 Feb 2019 17:03:37 +0100