liske / needrestart

Restart daemons after library updates.
GNU General Public License v2.0
426 stars 67 forks source link

batch mode output doesn't match nagios or regular output #231

Closed anarcat closed 2 years ago

anarcat commented 2 years ago

here's an example:

root@meronense:~# needrestart 
Scanning processes...                                                                                                                                                                          
Scanning candidates...                                                                                                                                                                         
Scanning linux images...                                                                                                                                                                       

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

User sessions running outdated binaries:
 metabase @ user manager service: systemd[729]
 root @ session #28017: start-web.sh[17485]

... so there's some stuff to restart here. Nagios confirms it:

root@meronense:~# needrestart -p
CRIT - Kernel: 4.19.0-18-amd64, Services: none, Containers: none, Sessions: 2 (!!)|Kernel=0;0;;0;2 Services=0;;0;0 Containers=0;;0;0 Sessions=2;0;;0
Sessions:
- metabase @ user manager service
- root @ session #28017

... yet batch mode is merrily unaware of this, what gives?

root@meronense:~# needrestart -b
NEEDRESTART-VER: 3.4
NEEDRESTART-KCUR: 4.19.0-18-amd64
NEEDRESTART-KEXP: 4.19.0-18-amd64
NEEDRESTART-KSTA: 1

maybe tied to #230, but i couldn't figure out extra options that would make the user sessions show up in batch mode, so i don't believe it's a documentation problem. feels more like a bug.