[Bug 2004203] Re: With needrestart, apt-get does not respect non-interactive instruction when upgrading services

Juerg Haefliger 2004203 at bugs.launchpad.net
Wed Jun 12 06:24:12 UTC 2024


@franz-s Sorry, just saw this. We typically don't backport new versions
but cherry-pick fixes. Can you give the package from this PPA [1] a try
and let me know if it fixes the issue?

[1] https://launchpad.net/~juergh/+archive/ubuntu/needrestart

** Also affects: needrestart (Ubuntu Jammy)
   Importance: Undecided
       Status: New

** Also affects: ubuntu-advantage-tools (Ubuntu Jammy)
   Importance: Undecided
       Status: New

** No longer affects: ubuntu-advantage-tools (Ubuntu Jammy)

** Changed in: needrestart (Ubuntu Jammy)
       Status: New => Confirmed

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

Title:
  With needrestart, apt-get does not respect non-interactive instruction
  when upgrading services

Status in needrestart package in Ubuntu:
  Fix Released
Status in ubuntu-advantage-tools package in Ubuntu:
  Invalid
Status in needrestart source package in Jammy:
  Confirmed

Bug description:
  For many years, I have had a script that checks for and installs
  available updates on Debian and Ubuntu servers.

  Code:

  #!/bin/bash
  apt-get update
  apt-get dist-upgrade -y
  [then clear cache, refresh snaps, restart if needed etc]

  With the Ubuntu 22.04 servers, it happily 'apt-get update's and then
  does the upgrade without pausing to ask if I want to do it :) but it
  then checks to see if any services need restarting and if any might
  do, asks if I want to restart them and won't continue until I answer.
  :( :( :(

  Typically some are preselected (if apache has been updated, then
  apache will be preselected, for example) and some are unselected
  (unattended-upgrades is the classic example). Sometimes, all are
  unselected meaning it doesn't think any do need restarting, but it
  will still stay waiting for my OK not to do so.

  More info is given than before:

  [do actual update]
  Scanning processes...                                                           
  Scanning candidates...                                                          
  Scanning linux images...                                                        

  Running kernel seems to be up-to-date.

  [wait for interaction here or after next line]
  Restarting services...
  Service restarts being deferred:
   systemctl restart systemd-logind.service
   systemctl restart unattended-upgrades.service

  No containers need to be restarted.

  No user sessions are running outdated binaries.

  No VM guests are running outdated hypervisor (qemu) binaries on this host.
  [all done!]                                         

  So some significant stuff has changed, but if I do

  man apt-get

  there is no indication that the behaviour has been changed like this:
  the bit about the -y command line option still says "run non-
  interactively", yet there it is waiting for interaction. There is also
  no indication of any new command line option to really be non-
  interactive.

  It is lovely that it is now explicitly checking things like this, but
  if I ask for a non-interactive upgrade, I should get a non-interactive
  upgrade!

  I have not come across an instance where the suggestion about which
  services need restarting has been wrong, so I am happy to accept the
  recommendation and just restart/not restart as suggested.

  # lsb_release -a
  No LSB modules are available.
  Distributor ID:	Ubuntu
  Description:	Ubuntu 22.04.1 LTS
  Release:	22.04
  Codename:	jammy

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




More information about the foundations-bugs mailing list