Debian Bug report logs - #322457
install: please add an --atomic option

version graph

Package: coreutils; Maintainer for coreutils is Michael Stone <[email protected]>; Source for coreutils is src:coreutils (PTS, buildd, popcon).

Reported by: Marcin Owsiany <[email protected]>

Date: Wed, 10 Aug 2005 19:03:01 UTC

Severity: wishlist

Found in versions coreutils/5.2.1-2, coreutils/5.93-5

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Michael Stone <[email protected]>:
Bug#322457; Package coreutils. (full text, mbox, link).


Acknowledgement sent to Marcin Owsiany <[email protected]>:
New Bug report received and forwarded. Copy sent to Michael Stone <[email protected]>. (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Marcin Owsiany <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: install: please add an --atomic option
Date: Wed, 10 Aug 2005 20:51:18 +0200
Package: coreutils
Version: 5.2.1-2
Severity: wishlist
Tags: upstream

Please add an --atomic option, which would make install create a
temporary file in destination directory, copy the data into it,
chmod/chown it as appropriate and then rename() to destination name.

This obviously should not be the default, since the destination
directory is not guaranteed to be writable.

Current behavior may cause problems when other program tries to open
the file while it is being installed. It does for me, I use install to
update a blacklist from a cronjob, and exim sometimes tries to open the
file before it is chmod-ed, causing deferrals.

regards,

Marcin

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11-1-k7
Locale: LANG=pl_PL, LC_CTYPE=pl_PL (charmap=ISO-8859-2)

Versions of packages coreutils depends on:
ii  libacl1                     2.2.29-1.0.1 Access control list shared library
ii  libc6                       2.3.2.ds1-22 GNU C Library: Shared libraries an

coreutils recommends no packages.

-- no debconf information



Tags removed: upstream Request was from Thomas Hood <[email protected]> to [email protected]. (full text, mbox, link).


Bug marked as found in version 5.93-5. Request was from Thomas Hood <[email protected]> to [email protected]. (full text, mbox, link).


Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#322457; Package coreutils. (full text, mbox, link).


Acknowledgement sent to [email protected]:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (full text, mbox, link).


Message #14 received at [email protected] (full text, mbox, reply):

From: Russell Coker <[email protected]>
To: [email protected]
Subject: coding this
Date: Wed, 27 Jun 2007 21:47:25 +1000
This would be a good feature to have, it's a pity that the internal copy() 
function in coreutils doesn't support this.

Probably the first step towards this goal would be to look at how to have cp, 
mv, etc all take advantage of copying to a temporary file that would be 
synchronised with fsync() before being renamed.  Also it would be good to 
have an option to call fsync() before close().  Sometimes you merely want to 
know that the data is committed to disk before the program returns.



Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#322457; Package coreutils. (full text, mbox, link).


Acknowledgement sent to Jim Meyering <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (full text, mbox, link).


Message #19 received at [email protected] (full text, mbox, reply):

From: Jim Meyering <[email protected]>
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Bug#322457: coding this
Date: Wed, 27 Jun 2007 15:39:56 +0200
Russell Coker <[email protected]> wrote:
> This would be a good feature to have, it's a pity that the internal copy()
> function in coreutils doesn't support this.
>
> Probably the first step towards this goal would be to look at how to have cp,
> mv, etc all take advantage of copying to a temporary file that would be
> synchronised with fsync() before being renamed.  Also it would be good to
> have an option to call fsync() before close().  Sometimes you merely want to
> know that the data is committed to disk before the program returns.

These do sound like nice additions.

It's probably going overboard, but some application might
even want to call fsync on each containing directory.



Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#322457; Package coreutils. (full text, mbox, link).


Acknowledgement sent to [email protected]:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (full text, mbox, link).


Message #24 received at [email protected] (full text, mbox, reply):

From: Russell Coker <[email protected]>
To: Jim Meyering <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: Bug#322457: coding this
Date: Thu, 28 Jun 2007 00:02:04 +1000
On Wednesday 27 June 2007 23:39, Jim Meyering <[email protected]> wrote:
> It's probably going overboard, but some application might
> even want to call fsync on each containing directory.

I expect that the overhead of calling fsync on the directory is negligible 
compared to the overhead of calling it on the files.  So it might be best to 
just have a single option.



Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#322457; Package coreutils. (full text, mbox, link).


Acknowledgement sent to Paul Eggert <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (full text, mbox, link).


Message #29 received at [email protected] (full text, mbox, reply):

From: Paul Eggert <[email protected]>
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Bug#322457: coding this
Date: Fri, 29 Jun 2007 13:29:08 -0700
Russell Coker <[email protected]> wrote:

> Probably the first step towards this goal would be to look at how to have cp,
> mv, etc all take advantage of copying to a temporary file that would be
> synchronised with fsync() before being renamed.  Also it would be good to
> have an option to call fsync() before close().  Sometimes you merely want to
> know that the data is committed to disk before the program returns.

These both sound like nice additions, but I'd guess the fsync option
should be independent from the tempfile+rename option.  The original
request was only about tempfile+rename.

My vague impression is that fsync will make things run considerably
slower on many implementations, and it won't help the original
requester at all.  tempfile+rename fixes the problem that the original
request was about.  Probably part of the confusion here is due to the
choice of the name "--atomic" to mean tempfile+rename; in some sense
rename is atomic, but it's not the same sense that fsync is.



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 08:41:23 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.