]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Shm.pl
- use &hasParam() instead of IsChanConf for more commands
[infobot.git] / src / Shm.pl
index b9756bce3676b6e42d0e778fb9b1dddd73e60491..4d34170a391dd31bb35cef504990a7bb7e8b780e 100644 (file)
@@ -129,10 +129,12 @@ sub addForked {
        $continue++ if ($forked{$name}{PID} == $$);
 
        if ($continue) {
-           &DEBUG("hrm.. fork pid == mypid == $$; how did this happen?");
+           &WARN("hrm.. fork pid == mypid == $$; how did this happen?");
+
        } elsif ( -d "/proc/$forked{$name}{PID}") {
            &status("fork: still running; good. BAIL OUT.");
            return 0;
+
        } else {
            &WARN("Found dead fork; removing and resetting.");
            $continue = 1;
@@ -140,8 +142,10 @@ sub addForked {
 
        if ($continue) {
            # NOTHING.
+
        } elsif (time() - $time > 900) {        # stale fork > 15m.
            &status("forked: forked{$name} presumably exited without notifying us.");
+
        } else {                                # fresh fork.
            &msg($who, "$name is already running ". &Time2String(time() - $time));
            return 0;