From owner-freebsd-questions@FreeBSD.ORG Sun Mar 2 13:55:30 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CD16106566B for ; Sun, 2 Mar 2008 13:55:30 +0000 (UTC) (envelope-from colin.brace@gmail.com) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.186]) by mx1.freebsd.org (Postfix) with ESMTP id C21558FC21 for ; Sun, 2 Mar 2008 13:55:29 +0000 (UTC) (envelope-from colin.brace@gmail.com) Received: by fk-out-0910.google.com with SMTP id b27so6848125fka.11 for ; Sun, 02 Mar 2008 05:55:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; bh=O3RwB6luDzM4mbAIzsWsFIx785aXiz2sW6NQWnT3cHM=; b=wn8TdIbpsXpMjZy22+qbjQyVyvK5qT0iFSFHAhKNERRwOeCPv6k0LOMq+TtAbvs88zVNGyONN9ugzp5yIbLSOkSjcggiKWler1g8HzP7sox7iV8/+LBMiPQCYzhSms7BSpDjmKoW4b+x5Emek60xkWmqepRSQtYqAPzHG4c4g0E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=DhtK3sT4oslwkLRcW2NfnYy1WdZofmWW8HnSLJamsf9wtbmLTBF+pZLA73tojJRUquj1AwIWtGtUCgVlI8C+0Vga6iYqw+LUJnVSca+XUphmI33CUZ8mSO/+fayUDJEZzsSyGouUuQoFgKTuQaO8cFCeEgctiHv/+A7RIhwWzO8= Received: by 10.82.118.2 with SMTP id q2mr18030350buc.29.1204466128572; Sun, 02 Mar 2008 05:55:28 -0800 (PST) Received: by 10.82.108.2 with HTTP; Sun, 2 Mar 2008 05:55:28 -0800 (PST) Message-ID: Date: Sun, 2 Mar 2008 14:55:28 +0100 From: "Colin Brace" Sender: colin.brace@gmail.com To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: 1c045d2c91ce8b15 Subject: the daemon that won't die X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2008 13:55:30 -0000 Hi all, I made the mistake of trying to run 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