i.e. specifying the restart mode in an environment variable (which I found by Googling), but this also had no effect.
I could be wrong about this, but it seems to me as though when needrestart is run manually, it DOES observe the settings in /etc/needrestart/needrestart.conf, but when it is run automatically by apt, it DOESN'T observe the settings and always restarts services. Could apt be passing in a NEEDRESTART_MODE=a environment variable to cause this behaviour?
I have noticed the same thing on 3 servers after they were upgraded to 24.04.
I also tested the following:
sudo NEEDRESTART_MODE=l apt full-upgrade --autoremove
i.e. specifying the restart mode in an environment variable (which I found by Googling), but this also had no effect.
I could be wrong about this, but it seems to me as though when needrestart is run manually, it DOES observe the settings in /etc/needrestar t/needrestart. conf, but when it is run automatically by apt, it DOESN'T observe the settings and always restarts services. Could apt be passing in a NEEDRESTART_MODE=a environment variable to cause this behaviour?