[Bug 2065863] Re: needrestart causes kernel upgrade messages in motd

Launchpad Bug Tracker 2065863 at bugs.launchpad.net
Wed Jul 31 05:30:28 UTC 2024


This bug was fixed in the package needrestart - 3.6-7ubuntu4.1

---------------
needrestart (3.6-7ubuntu4.1) noble; urgency=medium

  * Prevent needrestart restarting itself (LP: #2067482)
  * d/p/ubuntu-mode.patch: Don't touch /run/reboot-required on kernel updates
    (LP: #2065863)
  * Ubuntu mode: disable it if restart mode has been explicitly set
    (LP: #2068543)
  * Add some inline documentation for the Ubuntu mode (LP: #2068573)
  * Don't restart the google-guest-agent service (LP: #2063442)

 -- Simon Chopin <schopin at ubuntu.com>  Fri, 14 Jun 2024 15:37:30 +0200

** Changed in: needrestart (Ubuntu Noble)
       Status: Fix Committed => Fix Released

-- 
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/2065863

Title:
  needrestart causes kernel upgrade messages in motd

Status in needrestart package in Ubuntu:
  Fix Released
Status in needrestart source package in Noble:
  Fix Released
Status in needrestart source package in Oracular:
  Fix Released

Bug description:
  [Impact]
  needrestart shouldn't be writing to /run/reboot-required for kernel updates, that should be reserved to update-manager

  [Test plan]

  We can use the mockuname thing from the autopkgtests to simulate a kernel
  version mismatch:

  # in a fresh VM
  pull-lp-source needrestart noble
  cd needrestart-3.6
  gcc -shared -fPIC -ldl debian/tests/mockuname.c -o mockuname.so
  LD_PRELOAD=$PWD/mockuname.so apt install hello
  # needrestart should complain that the system should be restarted
  test ! -x /run/reboot-required || echo test failed

  [Where problems could occur]

  That particular patch seems on the safer side, nothing in the code
  relies on this file being written to.

  [Original report]

  On Noble, I see this in my motd:

  *** System restart required ***
  Pending kernel upgrade!
  Running kernel version:
    6.8.0-22-generic
  Diagnostics:
    The currently running kernel version is not the expected kernel version 6.8.0-31-generic.

  I found this code in needrestart:

  /usr/sbin/needrestart:                              'The currently
  running kernel version is {kversion} which is not the expected kernel
  version {eversion}.',

  I'm told that it is incorrect for needrestart to be injecting this
  into motd. Steve points out that needrestart isn't installed on
  desktop and the behaviour shouldn't be different here, thinks that
  this shouldn't be injected into motd, and asked for a bug report for
  this.

  needrestart     3.6-7ubuntu4

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/needrestart/+bug/2065863/+subscriptions




More information about the foundations-bugs mailing list