This bug was fixed in the package ec2-hibinit-agent -
1.0.0-0ubuntu4~18.10.0

---------------
ec2-hibinit-agent (1.0.0-0ubuntu4~18.10.0) cosmic; urgency=medium

  * Backport to Cosmic (LP: #1812166)

ec2-hibinit-agent (1.0.0-0ubuntu4) disco; urgency=medium

  * Update grub configuration snippet even when it exists but has outdated
    content

ec2-hibinit-agent (1.0.0-0ubuntu3) disco; urgency=medium

  * Refer to root partition in resume=... the same way as GRUB2 refers to it
    (LP: #1818150)

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)

ec2-hibinit-agent (1.0.0-0ubuntu1) disco; urgency=medium

  * Initial release based on packaging of hibagent

 -- Balint Reczey <[email protected]>  Fri, 01 Mar 2019 23:05:14 +0100

** Changed in: ec2-hibinit-agent (Ubuntu Cosmic)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1817926

Title:
  Hibinit-agent starts even when instance hibernation is disabled

Status in ec2-hibinit-agent package in Ubuntu:
  Fix Released
Status in ec2-hibinit-agent source package in Trusty:
  Won't Fix
Status in ec2-hibinit-agent source package in Xenial:
  Fix Released
Status in ec2-hibinit-agent source package in Bionic:
  Fix Released
Status in ec2-hibinit-agent source package in Cosmic:
  Fix Released

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/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20180912
   1. Verify that hibernation is disabled:
     $  curl http://169.254.169.254/latest/meta-data/hibernation/configured
     false

   2. Install ec2-hibinit-agent if it is not installed already
   3. Verify that it does not start:

  $ service  hibinit-agent status
  ● hibinit-agent.service - EC2 instance hibernation setup agent
     Loaded: loaded (/lib/systemd/system/hibinit-agent.service; enabled; vendor 
preset: enabled)
     Active: inactive (dead) since Wed 2019-02-27 15:28:47 UTC; 54s ago
       Docs: file:/usr/share/doc/ec2-hibinit-agent/README
    Process: 26448 ExecStart=/usr/bin/hibinit-agent -c /etc/hibinit-config.cfg 
(code=exited, status=0/SUCCESS)
   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-agent[26448]: Instance Launch has 
not enabled Hibernation Configured Flag. hibinit-agent exiting!!
  Feb 27 15:28:47 ip-172-31-3-157 hibinit-agent[26448]: Instance Launch has not 
enabled Hibernation Configured Flag. hibinit-agent exiting!!
  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://169.254.169.254/latest/meta-data/hibernation/configured
     true

   6. Install ec2-hibinit-agent if it is not installed already
   7. Verify that it does start:

  $ service  hibinit-agent status
  ● hibinit-agent.service - EC2 instance hibernation setup agent
     Loaded: loaded (/lib/systemd/system/hibinit-agent.service; enabled; vendor 
preset: enabled)
     Active: inactive (dead) since Wed 2019-02-27 12:50:26 UTC; 2h 30min ago
       Docs: file:/usr/share/doc/ec2-hibinit-agent/README
   Main PID: 25259 (code=exited, status=0/SUCCESS)

  Feb 27 12:50:25 ip-172-31-3-157 hibinit-agent[25241]: Allocating 4194304000 
bytes in /swap-hibinit
  Feb 27 12:50:25 ip-172-31-3-157 hibinit-agent[25241]: Swap pre-heating is 
skipped, the swap blocks won't be touched during to ensure they are ready
  Feb 27 12:50:25 ip-172-31-3-157 hibinit-agent[25241]: Running: mkswap 
/swap-hibinit
  Feb 27 12:50:25 ip-172-31-3-157 hibinit-agent[25241]: Running: swapon 
/swap-hibinit
  Feb 27 12:50:25 ip-172-31-3-157 hibinit-agent[25241]: Updating the kernel 
offset for the swapfile: /swap-hibinit
  Feb 27 12:50:25 ip-172-31-3-157 hibinit-agent[25241]: Updating GRUB to use 
the device /dev/xvda1 with offset 595968 for resume
  Feb 27 12:50:25 ip-172-31-3-157 hibinit-agent[25241]: GRUB configuration is 
updated
  Feb 27 12:50:25 ip-172-31-3-157 hibinit-agent[25241]: Setting swap device to 
51713 with offset 595968
  Feb 27 12:50:25 ip-172-31-3-157 hibinit-agent[25241]: Done updating the swap 
offset. Turning swapoff
  Feb 27 12:50:25 ip-172-31-3-157 hibinit-agent[25241]: Running: swapoff 
/swap-hibinit

   8. Start a c4 instance from an encrypted EBS-backed AMI, with hibernation 
disabled.
   9. Verify that hibernation is disabled:

  $ curl http://169.254.169.254/latest/meta-data/hibernation/configured
  <?xml version="1.0" encoding="iso-8859-1"?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
  <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
   <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-agent.service - EC2 instance hibernation setup agent
     Loaded: loaded (/lib/systemd/system/hibinit-agent.service; enabled; vendor 
preset: enabled)
     Active: inactive (dead) since Wed 2019-02-27 15:28:47 UTC; 54s ago
       Docs: file:/usr/share/doc/ec2-hibinit-agent/README
    Process: 26448 ExecStart=/usr/bin/hibinit-agent -c /etc/hibinit-config.cfg 
(code=exited, status=0/SUCCESS)
   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-agent[26448]: Instance Launch has 
not enabled Hibernation Configured Flag. hibinit-agent exiting!!
  Feb 27 15:28:47 ip-172-31-3-157 hibinit-agent[26448]: Instance Launch has not 
enabled Hibernation Configured Flag. hibinit-agent exiting!!
  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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ec2-hibinit-agent/+bug/1817926/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~group.of.nepali.translators
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~group.of.nepali.translators
More help   : https://help.launchpad.net/ListHelp

Reply via email to