Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Mar 2008 14:55:28 +0100
From:      "Colin Brace" <cb@lim.nl>
To:        freebsd-questions@freebsd.org
Subject:   the daemon that won't die
Message-ID:  <aec9371b0803020555o122de458x700b249a3e3352e4@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi all,

I made the mistake of trying to run greyscanner
<http://www.ualberta.ca/~beck/nycbug06/scripts/greyscanner>; as a
regular user. Now, everytime it runs (every 30 minutes), there is a
cron error from user "operator" complaining that "you need to be root"
to run /usr/libexec/save-entropy. Moreover, each time this happens, an
instance of greyscanner, belonging to user operator, remains dormant
in memory, which means an additional instance of perl. After a day or
so most of my swap memory is used. up.

I have tried killing every PID associated with user operator and/or
greyscanner, but like Lazarus the thing keeps rising from the dead
every 30 mins. I can't figure out what process is keeping it alive.

FWIW, here is the relevant snippet from the script:

# daemonize and scan in a loop.

&daemonize;
while (1) {
    setlogsock('unix');
    openlog("greytrapper", 'pid', 'mail') || die "can't openlog";
    syslog('debug', "Scan started");
    my $pid;
    $pid = fork();
    if (!$pid) {
        # child. scan away...
        &scan;
        exit(0);
    }
    # parent waits and sleeps.
    wait;
    syslog('debug', "Scan completed");
    sleep($SCAN_INTERVAL);
}

I am not a perl programmer, and it is not immediately obvious what is
going on here.

So, how to I kill this bugger once and for all?

Thanks.

$ uname -r
7.0-PRERELEASE

-- 
  Colin Brace
  Amsterdam
  http://lim.nl



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?aec9371b0803020555o122de458x700b249a3e3352e4>