bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #22057] updatedb "atomic rename" is not atomic


From: Andreas Metzler
Subject: [bug #22057] updatedb "atomic rename" is not atomic
Date: Sat, 19 Jan 2008 19:04:44 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.0.13pre) Gecko/20070505 Iceape/1.0.9 (Debian-1.0.11~pre071022-0etch1)

URL:
  <http://savannah.gnu.org/bugs/?22057>

                 Summary: updatedb "atomic rename" is not atomic
                 Project: findutils
            Submitted by: ametzler
            Submitted on: Samstag 19.01.2008 um 20:04
                Category: updatedb
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: Justin Pryzby
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: None
           Fixed Release: None

    _______________________________________________________

Details:

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

8X-----------------------------------
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
|  mv $LOCATE_DB.n $LOCATE_DB
|  chmod 644 $LOCATE_DB
|else
8X-----------------------------------

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

rm ; mv ; chmod

with 

chmod 644 $LOCATE_DB.n
mv $LOCATE_DB.n $LOCATE_DB

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




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?22057>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]