-
Notifications
You must be signed in to change notification settings - Fork 82
Description
When the python script already terminated once the scan completes, it shows all python modules as uses obsolete script file(s):.
I think this happens here:
needrestart/perl/lib/NeedRestart/Interp/Python.pm
Lines 236 to 239 in 6d7a76b
| my %ret = map { | |
| my $stat = nr_stat("/proc/$pid/root/$_"); | |
| $_ => ( defined($stat) ? $stat->{ctime} : undef ); | |
| } keys %files; |
"/proc/$pid/root/..." is already gone cause the process is gone, so it will show all files with a missing timestamp, and I guess the main handler doesn't like this?
Inserting this after the block above seems to "fix" it:
%ret = () unless -d "/proc/$pid/root"; # ignore everything if process is already goneIt might be a good idea to generically ignore all processes that are already gone (no idea whether other interpreter modules have the same issue).
Context: debian trixie, running a lot of python scripts in icinga2 context (checks), and needrestart often wants to restart icinga due to python scripts that "use obsolete file(s)" (all false positives).