I have noticed an inconsistency with the behavior of linux smbfs
mounting a remote win2k server while a file is open for writing:
1) If a linux process opens a file that /doesn't exist/ on the
win2k server, while the file is open, other machines trying
to read the file give the usual 'Text file is busy' (linux) or
'file is in use by another process' (windows).
2) However, if a linux process opens a file that /does/ exist,
other machines can read the file just fine while it is open,
both linux and windows print the file's contents just fine.
It seems like a bug; why should it matter if the file exists or not?
If intentional, how can a unix program (or mount flags?) control
opening the windows file in such a way that the file is /always/
readable by other machines, without ever giving 'text file busy'
errors. Basically, I need behavior #2 above consistently.
VERSIONS
--------
Client is Redhat 9.0, running the default samba 2.2.7a-6.
The file server is Windows 2000.
I was able to confirm this behavior at a separate location,
where they are running redhat 9.0 with the latest Samba 3.x.x installed,
and I think they have a Windows 2003 server.
REPLICATION
-----------
The problem is replicated in the following screen history, using
a 'ping' command to hold the file open while other machines try
to read its log output.
Note that the *second* run of the 'ping' command is readable by
the other machines, while the first is not.
'win2k' is the remote win2k file server.
'linux1' is the local linux machine, win2k mounted as /win2k/c
'linux2' is the remote linux machine, win2k mounted as /win2k/c
------------------------------------------------------------------------- snip
[EMAIL PROTECTED] $ grep smbfs /etc/fstab <-- SHOW HOW LOCALHOST
MOUNTS THE WIN2K SERVER
//win2k/c /win2k/c smbfs noauto,uid=500,gid=500,dmask=775,fmask=775 0 0
[EMAIL PROTECTED] $ mount | grep win2k <-- SHOW MOUNT
//win2k/c on /win2k/c type smbfs (0)
[EMAIL PROTECTED] $ rm /win2k/c/foo.log <-- MAKE SURE LOG FILE
DOESNT EXIST
[EMAIL PROTECTED] $ ping localhost >& /win2k/c/foo.log & <-- REDIRECT A 'SLOW'
PROGRAM TO LOG
[1] 5778
[EMAIL PROTECTED] $ rsh linux2 cat /win2k/c/foo.log <-- REMOTE LINUX CAN'T
READ FILE
cat: /win2k/c/foo.log: Text file busy
[EMAIL PROTECTED] $ rsh win2k 'type c:\foo.log' <-- WIN2K SERVER CAN'T
READ FILE
The process cannot access the file because it is being used by another process.
[EMAIL PROTECTED] $ kill %% <-- KILL THE PROCESS,
CLOSING LOG
[1] + Terminated ping localhost >& /win2k/c/foo.log
[EMAIL PROTECTED] $ ls -la /win2k/c/foo.log <-- VERIFY LOG FILE NOW
EXISTS
-rwxrwxr-x 1 foo foo 14534 Oct 5 23:26 /win2k/c/foo.log
[EMAIL PROTECTED] $ ping localhost >& /win2k/c/foo.log & <-- RUN *SAME* COMMAND
AGAIN
[1] 6397 <-- (Only difference: file
exists)
[EMAIL PROTECTED] $ rsh linux2 cat /win2k/c/foo.log <-- REMOTE LINUX READS OK
PING localhost.erco.x (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.erco.x (127.0.0.1): icmp_seq=1 ttl=64 time=0.030 ms
64 bytes from localhost.erco.x (127.0.0.1): icmp_seq=2 ttl=64 time=0.030 ms
64 bytes from localhost.erco.x (127.0.0.1): icmp_seq=3 ttl=64 time=0.035 ms
[..]
[EMAIL PROTECTED] $ rsh win2k 'type c:\foo.log' <-- WIN2K SERVER READS OK
PING localhost.erco.x (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.erco.x (127.0.0.1): icmp_seq=1 ttl=64 time=0.030 ms
64 bytes from localhost.erco.x (127.0.0.1): icmp_seq=2 ttl=64 time=0.030 ms
64 bytes from localhost.erco.x (127.0.0.1): icmp_seq=3 ttl=64 time=0.035 ms
[..]
------------------------------------------------------------------------- snip
--
To unsubscribe from this list go to the following URL and read the
instructions: http://lists.samba.org/mailman/listinfo/samba