[Bug 2004203] Re: With needrestart, apt-get does not respect non-interactive instruction when upgrading services
Julian Andres Klode
2004203 at bugs.launchpad.net
Thu Nov 14 09:29:36 UTC 2024
Setting to Incomplete per previous comment as the bug template has not
been completed.
** Changed in: needrestart (Ubuntu Jammy)
Status: Confirmed => Incomplete
--
You received this bug notification because you are a member of Ubuntu
Sponsors, which is subscribed to the bug report.
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:
Incomplete
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 Ubuntu-sponsors
mailing list