[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Need help understanding this message



The help I need is what I might call 'deep' help. I know 'who'
is sending the message, and why, but how do I fix the problem?

Included is an email that I get from the daily cron job on a
host that I have named 'gq'. I have two other machines that never send
this message. All are similarly configured Lenny installations. 
This is the text of the email, including a few headers:
############################## start
From: Cron Daemon <root@gq.lan.gnu>
Date: Mon, 02 Mar 2009 04:41:00 -0700
To: root@gq.lan.gnu
Subject: Cron <root@gq> test -x /usr/sbin/anacron || ( cd / && run-parts
        --report /etc/cron.daily )

/etc/cron.daily/mlocate:
/usr/bin/updatedb.mlocate: `/var/lib/mlocate/mlocate.db' is locked (probably by
+an earlier updatedb)
run-parts: /etc/cron.daily/mlocate exited with return code 1
#####################################################(END) 

I include here, for reference a copy of cron.daily/mlocate:
############################## start
#! /bin/bash

set -e

[ -x /usr/bin/updatedb.mlocate ] || exit 0

##

LOCKFILE="/var/lib/mlocate/daily.lock"

trap "rm -f $LOCKFILE" EXIT

if [ -e "$LOCKFILE" ]; then
    echo >&2 "Warning: $LOCKFILE present, not running today."
    exit 1
else
    touch "$LOCKFILE"
fi

##

# See ionice(1)
if [ -x /usr/bin/ionice ] &&
    /usr/bin/ionice -c3 true 2>/dev/null; then
    IONICE="/usr/bin/ionice -c3"
fi

$IONICE /usr/bin/updatedb.mlocate
#####################################################(END) 

The reported event happens early in the morning. When I first check my
email, I immediately check for a lock file where this little script is
programmed to place it. It does not exist. I also note that the error
message that this script is programmed to issue, is not the error
message that I actually recieve in the email. mlocate.db has an mtime
stamp from Feb 25, so clearly I need to fix something, but what?  The
code of the script /etc/cron.daily/mlocate is exactly the same on all
three machines. Could a bad execution of 'trap' somehow corrupted an
OS internal table? How can I check what traps are set? Where is the
message, that I get, actually being generated? Etc.? I suppose I could
just reboot the machine, but I'd like to understand.

TIA
-- 
Paul E Condon           
pecondon@mesanetworks.net


Reply to: