]> git.donarmstrong.com Git - infobot.git/commitdiff
- kill fork if it has run for too long, and still exists!
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 15 Dec 2001 12:59:05 +0000 (12:59 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 15 Dec 2001 12:59:05 +0000 (12:59 +0000)
- typo in ignoreAdd; use makeHostMask.

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@532 c11ca15a-4712-0410-83d8-924469b57eb5

src/Factoids/Core.pl
src/Misc.pl
src/Shm.pl

index 5a473d4ab70442263b2c30d5cd60883fef35f500..d8d559a0a8b2202a5afc1521f16f174314c1113b 100644 (file)
@@ -178,7 +178,7 @@ sub FactoidStuff {
                # todo: make forget limit configurable.
                # todo: make forget ignore time configurable.
                if ($cache{forget}{$h} > 5) {
-                   &ignoreAdd($mask{nuh}, "*", 3*24*60*60, "abuse of forget");
+                   &ignoreAdd(&makeHostMask($nuh), "*", 3*24*60*60, "abuse of forget");
                    &msg($who, "forget: Suck it!");
                }
            }
index c0e25dc625b84588438d1d9c951c76cbcd9c8c55..5e9bf14579e37cca3dbe4e7ead99a0ad1c823c4e 100644 (file)
@@ -475,6 +475,7 @@ sub makeHostMask {
 
     if ($host =~ s/^(\S+!\S+\@)//) {
        &DEBUG("mHM: detected nick!user\@ for host arg; fixing");
+       &DEBUG("nu => $nu");
        $nu = $1;
     }
 
index 4d34170a391dd31bb35cef504990a7bb7e8b780e..6412e4db531d6eac36ea6e1a850eef058204958d 100644 (file)
@@ -96,8 +96,15 @@ sub addForked {
        next unless ($time > $forker_timeout);
 
        ### TODO: use &time2string()?
-       &WARN("Fork: looks like we lost '$_', executed $time ago.");
-       delete $forked{$_};
+       &WARN("Fork: looks like we lost '$_', executed $time ago");
+
+       if ( -d "/proc/$forked{$name}{PID}") {
+           my $pid = $forked{$name}{PID};
+           &status("Fork: killing $name ($pid)");
+           kill 9, $pid;
+       }
+
+       delete $forked{$name};
     }
 
     my $count = 0;