SUMMARY: ?Bug in mv in TU50

From: Michael A Crowley <mcrowley_at_MtHolyoke.edu>
Date: Sat, 28 Oct 2000 13:15:54 -0400 (EDT)

The question (full text at end) involved a problem where "mv x y"
would result in no file "x" or "y", often without setting an errorlevel
of other than zero.

Tom Blinn replied that TU 5.0 should be avoided in favor of 5.0a or
5.1. I also had neglected to mention that the filesystem was UFS.

He suggested trying the 'mv' sequence:
        rm -f passwd.pag
        ln passwd.pag.newone passwd.pag
        rm -f passwd.pag.newone
A related sequences might also be:
        ln -f passwd.pag.newone passwd.pag
          [test to see if they are both there under same inode]
        rm -f passwd.pag.newone

However, nobody reported seeing this error. So I will be interested
in seeing if the problem on this system vanishes once we get it to 5.0a.

I also should have mentioned that the script that does all this has
been pretty much unchanged since early days -- Ultrix 2.x -- and
was fine on DU 4.0b.

-mike

>>
>> I have experienced some odd problems with "mv" in TU50, without and
>> with patch level 1, in which the target file vanishes, sometimes
>> without an errorlevel being set.
>>
>> For example, in this code fragment (let's not worry
>> about why I'm doing this in this way):
>> # added -f 20oct00 to see if it fixes problem
>> mv -f /etc/passwd.pag.newone /etc/passwd.pag
>> ErrPag=$?
>> mv -f /etc/passwd.dir.newone /etc/passwd.dir
>> ErrDir=$?
>> occasionally the pag or dir file vanishes, along with the source file.
>> Sometimes errorlevel is set to "2", but not always. This has also
>> occurred intermittently with 'mv' of other system files that are
>> potentially being accessed by others.
>>
>> I have not yet done any tests of whether having the source file
>> open when a move is done has any effect. But with that kind of
>> idea in mind with regard to the target files, I tried preceeding
>> the above with:
>> mv /etc/passwd.dir /etc/passwd.dir-
>> mv /etc/passwd.pag /etc/passwd.pag-
>> and the problem remains, even though when the failure occurs,
>> the two file moves just above have been successful (the
>> inode of what had been /etc/passwd.dir is now /etc/passwd.dir- ...).
>>
>> Anyone seen or dealt with anything like this?
>>
>> thanks,
>> -mike
>>
>> -----------------------------------------------------------------------------
>> Michael A. Crowley Director of Networking
>> mcrowley_at_mtholyoke.edu 216 Dwight Hall, Mount Holyoke College
>> 413-538-2140 fax: 413-538-2331 South Hadley, MA 01075-6415
>> http://www.mtholyoke.edu/~mcrowley http://www.mtholyoke.edu/lits/network
>> -----------------------------------------------------------------------------
>
Received on Sat Oct 28 2000 - 17:17:48 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:41 NZDT