mlocate cron job doesn't respect its lockfile
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mlocate (Debian) |
Fix Released
|
Unknown
|
|||
mlocate (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: mlocate
The mlocate cron job (/etc/cron.
The bug is pretty obvious. From /etc/cron.
-----
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
Changed in mlocate (Debian): | |
status: | Unknown → Fix Released |
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 <email address hidden> Thu, 20 Jun 2013 15:03:51 +0100