[Bug 2004203] Re: With needrestart, apt-get does not respect non-interactive instruction when upgrading services
Launchpad Bug Tracker
2004203 at bugs.launchpad.net
Sat Mar 9 00:02:43 UTC 2024
This bug was fixed in the package needrestart - 3.6-7ubuntu3
---------------
needrestart (3.6-7ubuntu3) noble; urgency=medium
* debian/tests:
- prompt-reboot: mark the tests as needing a VM since needrestart doesn't
do kernel detection when within a container
- *.py: migrate off some deprecated libtmux APIs
- *.py: make tests less sensible to performance issues on the runners
-- Simon Chopin <schopin at ubuntu.com> Fri, 08 Mar 2024 16:01:08 +0100
** Changed in: needrestart (Ubuntu)
Status: Confirmed => 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/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
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