[Bug 731632] Re: mlocate cron job doesn't respect its lockfile
Colin Watson
cjwatson at canonical.com
Thu Jun 20 14:06:21 UTC 2013
** Bug watch added: Debian Bug tracker #611096
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=611096
** Also affects: mlocate (Debian) via
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=611096
Importance: Unknown
Status: Unknown
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to mlocate in Ubuntu.
https://bugs.launchpad.net/bugs/731632
Title:
mlocate cron job doesn't respect its lockfile
Status in “mlocate” package in Ubuntu:
New
Status in “mlocate” package in Debian:
Unknown
Bug description:
Binary package hint: mlocate
The mlocate cron job (/etc/cron.daily/mlocate) doesn't always respect
its lockfile. The cron job always removes the lockfile, even if it
aborts because the lockfile already exists. The result is that every
other concurrent invocation of /etc/cron.daily/mlocate will run
updatedb.
The bug is pretty obvious. From /etc/cron.daily/mlocate:
-----
trap "rm -f $LOCKFILE" EXIT
if [ -e "$LOCKFILE" ]; then
echo >&2 "Warning: $LOCKFILE present, not running updatedb."
exit 1
else
touch "$LOCKFILE"
fi
-----
The trap to remove the lockfile is turned on before checking for the
existence of the lockfile. So even if the lockfile exists, we rm it
on exit. Moving the trap inside the else block should fix it.
# lsb_release -rd
Description: Ubuntu 10.04 LTS
Release: 10.04
# apt-cache policy mlocate
mlocate:
Installed: 0.22.2-1ubuntu1
Candidate: 0.22.2-1ubuntu1
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mlocate/+bug/731632/+subscriptions
More information about the foundations-bugs
mailing list