Problem still exists in debian 10
After installing needrestart and doing a apt upgrade you get the following :
[...]
Setting up libirs161:amd64 (1:9.11.5.P4+dfsg-5.1+deb10u7) ...
Setting up bind9-host (1:9.11.5.P4+dfsg-5.1+deb10u7) ...
Setting up dnsutils (1:9.11.5.P4+dfsg-5.1+deb10u7) ...
Processing triggers for libc-bin (2.28-10+deb10u1) ...
Processing triggers for mime-support (3.62) ...
Scanning processes...
Scanning candidates...
Failed to check for processor microcode upgrades.
Restarting services...
invoke-rc.d cron restart
invoke-rc.d nagios-nrpe-server restart
invoke-rc.d nullmailer restart
invoke-rc.d open-vm-tools restart
invoke-rc.d openntpd restart
invoke-rc.d snmpd restart
invoke-rc.d ssh restart
invoke-rc.d syslog-ng restart
invoke-rc.d ulogd2 restart
invoke-rc.d unbound restart
No containers need to be restarted.
User sessions running outdated binaries:
root @ /dev/pts/0: bash[10397]
Message from root@kddns-sv03-stage on (none) at 18:09 ...
Your session is running obsolete binaries or libraries as listed below.
Please consider a relogin or restart of the affected processes!
1 bash[10397]
EOF
root @ /dev/tty1: getty[2053]
root @ /dev/tty2: getty[2054]
root @ /dev/tty3: getty[2055]
root @ /dev/tty4: getty[2056]
root @ /dev/tty5: getty[2057]
root @ /dev/tty6: getty[2058]
There it sits ad-vitam... you can only do a ctrl+c to get out of it.
The faulty process :
├─sshd,10395
│ └─bash,10397
│ └─apt-get,10865 upgrade -y
│ └─apt-get,12265 upgrade -y
│ └─sh,12266 -c test -x
/usr/lib/needrestart/apt-pinvoke && /usr/lib/needrestart/apt-pinvoke || true
│ └─frontend,12267 -w /usr/share/debconf/frontend
/usr/sbin/needrestart
│ └─(needrestart,12277)
As you can expect this is a problem for automation or running a Ansible
playbook ... kinda defeats the purpose of a non-interactive action, not
to mention the fact that it shouldn't happen in the first place.