[Bug 2059337] Re: noble: needrestart triggering SIGTERM of cloud-final.service preventing apt packages from being installed when cloud-init is also being upgraded

Chad Smith 2059337 at bugs.launchpad.net
Thu Apr 25 14:41:38 UTC 2024


** Changed in: cloud-init (Ubuntu)
       Status: Confirmed => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to needrestart in Ubuntu.
https://bugs.launchpad.net/bugs/2059337

Title:
  noble: needrestart triggering SIGTERM of cloud-final.service
  preventing apt packages from being installed when cloud-init is also
  being upgraded

Status in cloud-init package in Ubuntu:
  Invalid
Status in needrestart package in Ubuntu:
  Fix Released
Status in cloud-init source package in Noble:
  Won't Fix
Status in needrestart source package in Noble:
  Fix Released

Bug description:
  Recent downstream ubuntu-specific changes in needrestart version
  3.6-7ubuntu1 [1] set Ubuntu into autorestart mode when non-interactive
  apt-get dist-upgrade is being performed.

  This causes an acute issue for cloud-init when #cloud-config user-data
  tries to perform apt-get dist-upgrade and package installs via user-
  data[2] like the following:

  #cloud-config
  package_update: true
  package_upgrade: true
  packages: [sl]

  Since cloud-init runs apt-get dist-upgrade in cloud-final.service in
  non-interactive mode, Ubuntu's behavior looks to set the default
  "opt_r" mode to "a" (automatic). This causes problems when cloud-init
  package is also being upgraded by dist-upgrade as needrestart will
  collect the currently running cloud-final.service and determine it is
  a target for automtic restart.

  The immediate SIGTERM of cloud-final.service prevents cloud-init from
  completing any of the remaining config modules in the cloud-final boot
  stage, notably, the additional package installs requested by the
  `packages:` directive in user data.

  Given that cloud-final.service is a oneshot service, that can spawn
  apt-get dist-upgrade. I'd propose that minimally Ubuntu initially
  carries a downstream patch to skip automated restart of cloud-
  final.service[3]. I don't see an easier way to inject other skip regex
  into /etc/needrestart/needrestart.conf via
  /etc/needrestart/conf.d/cloud-init.conf that would allow us to augment
  the list of skip regexs on a per-package basis.

  References:

  [1] Ubuntu needrestart setting automatic restart mode when non-interactive on Ubuntu https://git.launchpad.net/ubuntu/+source/needrestart/tree/debian/patches/ubuntu-mode.patch?id=0ee54f20335d49ba3c330e5f8328e88a8cc3f99b#n72
  [2] Upstream cloud-init bug: cloud-final.service getting sigterm before installing packages https://github.com/canonical/cloud-init/issues/5109
  [3] downstream packaging proposal: https://code.launchpad.net/~chad.smith/ubuntu/+source/needrestart/+git/needrestart/+merge/463236

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/2059337/+subscriptions




More information about the foundations-bugs mailing list