Package: needrestart
Version: 3.6-4
Tags: patch upstream

Hi,

I noticed that needrestart wouldn't reliably restart debci. Looking
deeper I noticed that a missing process was a Ruby process. Its $bin was
resolved as "/usr/bin/ruby3.1". If you look at the isa sub in
Interp/Ruby.pm, you see that it'll reject this as a Ruby process due to
the version. Hence, the process is ignored and not restarted. I'm
attaching a patch that extends the process pattern to allow a versioned
interpreter.

Helmut
--- needrestart-3.6.orig/perl/lib/NeedRestart/Interp/Ruby.pm
+++ needrestart-3.6/perl/lib/NeedRestart/Interp/Ruby.pm
@@ -42,7 +42,7 @@ sub isa {
     my $pid = shift;
     my $bin = shift;
 
-    return 1 if($bin =~ m@^/usr/(local/)?bin/ruby$@);
+    return 1 if($bin =~ m@^/usr/(local/)?bin/ruby(\d+\.\d+)?$@);
 
     return 0;
 }

Reply via email to