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


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

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

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


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

Fixed in 4.3.x.

James Youngman <jay>
Project Administrator
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 Administrator
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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    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 -email is unavailable-

    Back to the top

    Powered by Savane 3.9