bugfindutils - Bugs: bug #22057, updatedb "atomic rename"...


bug #22057: updatedb "atomic rename" is not atomic

Submitted by:  Andreas Metzler <ametzler>
Submitted on:  Sat 19 Jan 2008 07:04:43 PM UTC  
Category:  updatedb Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  James Youngman <jay>
Originator Name:  Justin Pryzby Open/Closed:  Closed
Release:  4.3.12 Fixed Release:  4.3.13

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sat 09 Feb 2008 10:17:20 AM UTC, comment #2: 

Fixed in 4.3.x.

James Youngman <jay>
Project AdministratorIn charge of this item.
Fri 25 Jan 2008 09:46:22 PM UTC, comment #1: 

Running instances of locate will not notice, due to the semantics of Unix filesystems. 

The resut may not be portable to Cygwin, but I think that's a matter best dealt with - if necessary - by patches in the Cygwin port.

James Youngman <jay>
Project AdministratorIn charge of this item.
Sat 19 Jan 2008 07:04:43 PM UTC, original submission:  

This is http://bugs.debian.org/461585

An atomic rename involves a "mv" without an "rm", with the chmod on
the .n file beforehand.

|# To reduce the chances of breaking locate while this script is running,
|# put the results in a temp file, then rename it atomically.
|if test -s $LOCATE_DB.n; then
|  rm -f $LOCATE_DB
|  chmod 644 $LOCATE_DB

I am forwarding this, since I am undecided whether this is actually a bug. Replacing

rm ; mv ; chmod


chmod 644 $LOCATE_DB.n

has the bonus that $LOCATE_DB is present all the time. The downside is that an already running locate process might act strangely if its input data is changing.

cu andreas

Andreas Metzler <ametzler>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jay (Posted a comment)
  • -email is unavailable- added by ametzler

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-02-14 jay Open/ClosedOpen => Closed
        Fixed ReleaseNone => 4.3.13
    2008-02-09 jay StatusIn Progress => Fixed
    2008-01-25 jay StatusNone => In Progress
        Assigned toNone => jay
        ReleaseNone => 4.3.12
    2008-01-19 ametzler Carbon-CopyRemoved 20807 => -
    2008-01-19 ametzler Carbon-Copy- => Added 461585-submitter@bugs.debian.org

    Back to the top

    Powered by Savane 3.5