[Bug 731632] Re: mlocate cron job doesn't respect its lockfile
Launchpad Bug Tracker
731632 at bugs.launchpad.net
Thu Jun 20 15:41:19 UTC 2013
This bug was fixed in the package mlocate - 0.26-1ubuntu1
---------------
mlocate (0.26-1ubuntu1) saucy; urgency=low
* Resynchronise with Debian (locking fix closes LP: #731632). Remaining
changes:
- Add ecryptfs, fusesmb, and devtmpfs to PRUNEFS.
- Add /home/.ecryptfs to PRUNEPATHS.
mlocate (0.26-1) unstable; urgency=low
* New upstream release. Closes: #669368
- Stops using PATH_MAX. Closes: #610209
* The filesystem type for Lustre is lustre, not lustre_lite. Update
updatedb.conf accordingly. Closes: #660781
* Fix up locking in cron.daily. Closes: #611096
* rm -rf /var/lib/mlocate on purge, don't just take out single files.
Closes: #542616
-- Colin Watson <cjwatson at ubuntu.com> Thu, 20 Jun 2013 15:03:51 +0100
** Changed in: mlocate (Ubuntu)
Status: New => Fix Released
--
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:
Fix Released
Status in “mlocate” package in Debian:
Fix Released
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