Re: rsync on cygwin is hanging

2003-07-21 Thread jw schultz
On Sat, Jul 19, 2003 at 04:06:54PM -0400, Jeff Hedlund wrote:
 
 I am trying to backup a Windows machine to a Linux machine using rsync 
 (over ssh).
 
 I have been able to successfully sync a few files at a time, but when I 
 try to backup an entire tree the process hangs on both machines.
 
 I believe this is a different problem than one posted on here before, 
 but I did try this patch with no success: 
 http://www.mail-archive.com/[EMAIL PROTECTED]/msg07525.html
 
 When I try to rsync a tree, it will usually create a partial directory 
 structure and download a few files and then hang.
 
 Linux:  RH 7.3, rsync 2.5.6, OpenSSH_3.1p1
 Cygwin: 5.0, rsync 2.5.6, OpenSSH_3.6.1p1
 
 Let me know if more information is needed (and I apologize if too much 
 is sent) :).
 
 I am running the following on the linux machine:
 rsync -vvrltDH --numeric-ids -pgo --stats --exclude-from=exclude.list 
 --rsh=ssh [EMAIL PROTECTED]:c:/WINNT/ tree

It looks like the rsync server on cygwin is failing to
return from a write to stdout.

I know (from prior offline discussion) you are using ssh key
based command restriction via a wrapper script on the linux
rsync servers.  Are you using a ssh key based command
restriction here as well?  You don't mention that anywhere
in this email.

If you are running rsync via a wrapper script does the
script exec the rsync command or run it as a child process?

I trimmed the traces a bit to better reflect suitable
inlining.  You have a bad problem with linewrap messing up
the traces.

See my comments below and the cygwin annotations.  This is
the first time i've seen a cygwin strace. Interesting.

 
 Here is the tail end of the output from that command where it hangs:
 
 --- rsync.out ---
 system32/wbem/mof/
 system32/wbem/mof/bad/
 system32/wbem/mof/good/
 system32/wins/
 twain_32/
 twain_32/fjscan/
 twain_32/fjscan/fcpa/
 twain_32/logiscan/
 twain_32/miitwain/
 wudnld20.tmp/
 --- eof: rsync.out ---
 
 Here is the strace on the linux machine where it hangs:
 
 --- strace.out (on linux machine) ---
[snip]
 lstat64(winrep.exe, 0xba20)   = -1 ENOENT (No such file or 
 directory)
 lstat64(wudnld20.tmp, 0xba20) = -1 ENOENT (No such file or 
 directory)
 mkdir(wudnld20.tmp, 040700)   = 0
 lstat64(wudnld20.tmp, {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
 time(NULL)  = 1058644307
 utime(wudnld20.tmp, [2003/07/19-15:51:47, 2002/01/25-01:17:08]) = 0
 lchown32(0x8074940, 0x220, 0x201)   = 0
 write(1, wudnld20.tmp/\n, 14) = 14
 select(8, [7], [4], NULL, {60, 0})  = 1 (out [4], left {60, 0})
 write(4, \274\2\0\0\0\0\0\0\202\36\0\0\0\0\0\0\274\2\0\0\0\0\0\0..., 
 3916)
= 3916
 select(8, [3 7], NULL, NULL, {60, 0})   = 0 (Timeout)
 select(8, [3 7], NULL, NULL, {60, 0}) = 0 (Timeout)
 select(8, [3 7], NULL, NULL, {60, 0}) = 0 (Timeout)
 select(8, [3 7], NULL, NULL, {60, 0}) = 0 (Timeout)
 select(8, [3 7], NULL, NULL, {60, 0}) = 0 (Timeout)
 select(8, [3 7], NULL, NULL, {60, 0}
 --- eof: strace.out (on linux machine) ---

Waiting for another process to send something.

 Here is the output of the child rsync process on the linux box:
 
 --- strace.out.3341 (child rsync on linux machine) ---
[snip]
 select(6, [5], NULL, NULL, {60, 0}) = 1 (in [5], left {60, 0})
 read(5, TNAME\3\0\0\0\20\1\0\22nameSpaceSeparator\3..., 4092) = 4092
 select(6, [5], NULL, NULL, {60, 0}) = 1 (in [5], left {60, 0})
 read(5, \374\17\0\7, 4)   = 4
 select(6, [5], NULL, NULL, {60, 0}) = 1 (in [5], left {60, 0})
 read(5, \0\0\0\0\0\20\3A\0y\0\2\0\4\0\0\0\4\0\1\3\'\0\1\0\0\0h..., 
 4092) = 4092
 select(6, [5], NULL, NULL, {60, 0}) = 1 (in [5], left {60, 0})
 read(5, \374\17\0\7, 4)   = 4
 select(6, [5], NULL, NULL, {60, 0}) = 1 (in [5], left {60, 0})
 read(5, |\22\260\266\0\202*\20\266\0\264\266\0\202\23\2\f\266..., 
 4092) = 2662
 select(6, [5], NULL, NULL, {60, 0})   = 0 (Timeout)
 select(6, [5], NULL, NULL, {60, 0})   = 0 (Timeout)
 select(6, [5], NULL, NULL, {60, 0})   = 0 (Timeout)
 select(6, [5], NULL, NULL, {60, 0})   = 0 (Timeout)
 select(6, [5], NULL, NULL, {60, 0})   = 0 (Timeout)
 select(6, [5], NULL, NULL, {60, 0})   = 0 (Timeout)
 select(6, [5], NULL, NULL, {60, 0}
 
 --- eof: strace.out.3341 (child rsync on linux machine ---

Waiting for another process to send something.

 And finally, here is the tail end of the strace on the cygwin box:
 
 --- strace.out (on cygwin) ---
[snip and cleaned up to fix line-wrap errors]
start of write()
   342 29382720 [main] rsync 2036 writev: writev (1, 0x226AC0, 1)
   184 29382904 [main] rsync 2036 fhandler_base::write: binary write
   222 29383126 [main] rsync 2036 fhandler_base::write: 4096 = write (0x226B30, 4 096)
   193 29383319 [main] rsync 2036 writev: 4096 = write (1, 0x226AC0, 1), errno 0
completion of write()
good to know what that looks like

   217 29383536 [main] rsync 2036 cygwin_select: 2, 0x0, 0x226B00, 0x0, 0x226AF0
   351 29383887 

Re: rsync on cygwin is hanging

2003-07-21 Thread Jeff Hedlund
jw schultz wrote:
It looks like the rsync server on cygwin is failing to
return from a write to stdout.
I know (from prior offline discussion) you are using ssh key
based command restriction via a wrapper script on the linux
rsync servers.  Are you using a ssh key based command
restriction here as well?  You don't mention that anywhere
in this email.
I am using an authorized_key, but no command restriction on the windows
server.
If you are running rsync via a wrapper script does the
script exec the rsync command or run it as a child process?
No wrapper script.  So rsync is a child of the ssh process.

Ahh, write didn't complete.  We have an i/o error outside of rsync.
Where do I go from here?  I did an strace of the cygwin ssh process on
another rsync (same command), here are the last few lines:
  238 1848347 [main] sshd 1668 peek_socket: considering handle 0x10
  189 1848536 [main] sshd 1668 peek_socket: adding read fd_set
/dev/tcp, fd 4
  218 1848754 [main] sshd 1668 peek_socket: WINSOCK_SELECT returned 0
  593 1849347 [main] sshd 1668 select_stuff::poll: returning 1
  199 1849546 [main] sshd 1668 select_stuff::cleanup: calling cleanup
routines
  188 1849734 [main] sshd 1668 select_stuff::~select_stuff: deleting
select records
  662 1850396 [main] sshd 1668 set_process_mask: old mask = 0, new mask
= 8
  192 1850588 [main] sshd 1668 set_process_mask: old mask = 8, new
  mask = 0
  200 1850788 [main] sshd 1668 writev: writev (7, 0x22F500, 1)
  191 1850979 [main] sshd 1668 fhandler_base::write: binary write
Thanks,
Jeff
--
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


rsync on cygwin is hanging

2003-07-19 Thread Jeff Hedlund
I am trying to backup a Windows machine to a Linux machine using rsync 
(over ssh).

I have been able to successfully sync a few files at a time, but when I 
try to backup an entire tree the process hangs on both machines.

I believe this is a different problem than one posted on here before, 
but I did try this patch with no success: 
http://www.mail-archive.com/[EMAIL PROTECTED]/msg07525.html

When I try to rsync a tree, it will usually create a partial directory 
structure and download a few files and then hang.

Linux:  RH 7.3, rsync 2.5.6, OpenSSH_3.1p1
Cygwin: 5.0, rsync 2.5.6, OpenSSH_3.6.1p1
Let me know if more information is needed (and I apologize if too much 
is sent) :).

I am running the following on the linux machine:
rsync -vvrltDH --numeric-ids -pgo --stats --exclude-from=exclude.list 
--rsh=ssh [EMAIL PROTECTED]:c:/WINNT/ tree

Here is the tail end of the output from that command where it hangs:

--- rsync.out ---
system32/wbem/mof/
system32/wbem/mof/bad/
system32/wbem/mof/good/
system32/wins/
twain_32/
twain_32/fjscan/
twain_32/fjscan/fcpa/
twain_32/logiscan/
twain_32/miitwain/
wudnld20.tmp/
--- eof: rsync.out ---
Here is the strace on the linux machine where it hangs:

--- strace.out (on linux machine) ---
lstat64(twunk_16.exe, 0xba20) = -1 ENOENT (No such file or 
directory)
lstat64(twunk_32.exe, 0xba20) = -1 ENOENT (No such file or 
directory)
lstat64(upwizun.exe, 0xba20)  = -1 ENOENT (No such file or 
directory)
lstat64(vb.ini, 0xba20)   = -1 ENOENT (No such file or 
directory)
lstat64(vbaddin.ini, 0xba20)  = -1 ENOENT (No such file or 
directory)
lstat64(vmmreg32.dll, 0xba20) = -1 ENOENT (No such file or 
directory)
lstat64(welcome.exe, 0xba20)  = -1 ENOENT (No such file or 
directory)
lstat64(welcome.ini, 0xba20)  = -1 ENOENT (No such file or 
directory)
lstat64(win.ini, 0xba20)  = -1 ENOENT (No such file or 
directory)
lstat64(winhelp.exe, 0xba20)  = -1 ENOENT (No such file or 
directory)
lstat64(winhlp32.exe, 0xba20) = -1 ENOENT (No such file or 
directory)
lstat64(winnt.bmp, 0xba20)= -1 ENOENT (No such file or 
directory)
lstat64(winnt256.bmp, 0xba20) = -1 ENOENT (No such file or 
directory)
lstat64(winrep.exe, 0xba20)   = -1 ENOENT (No such file or 
directory)
lstat64(wudnld20.tmp, 0xba20) = -1 ENOENT (No such file or 
directory)
mkdir(wudnld20.tmp, 040700)   = 0
lstat64(wudnld20.tmp, {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
time(NULL)  = 1058644307
utime(wudnld20.tmp, [2003/07/19-15:51:47, 2002/01/25-01:17:08]) = 0
lchown32(0x8074940, 0x220, 0x201)   = 0
write(1, wudnld20.tmp/\n, 14) = 14
select(8, [7], [4], NULL, {60, 0})  = 1 (out [4], left {60, 0})
write(4, \274\2\0\0\0\0\0\0\202\36\0\0\0\0\0\0\274\2\0\0\0\0\0\0..., 
3916)
   = 3916
select(8, [3 7], NULL, NULL, {60, 0})   = 0 (Timeout)
select(8, [3 7], NULL, NULL, {60, 0}) = 0 (Timeout)
select(8, [3 7], NULL, NULL, {60, 0}) = 0 (Timeout)
select(8, [3 7], NULL, NULL, {60, 0}) = 0 (Timeout)
select(8, [3 7], NULL, NULL, {60, 0}) = 0 (Timeout)
select(8, [3 7], NULL, NULL, {60, 0}
--- eof: strace.out (on linux machine) ---



Here is the output of the child rsync process on the linux box:

--- strace.out.3341 (child rsync on linux machine) ---
close(3)= 0
close(7)= 0
close(4)= 0
fcntl64(8, F_GETFL) = 0x802 (flags O_RDWR|O_NONBLOCK)
select(6, [5], NULL, NULL, {60, 0}) = 1 (in [5], left {60, 0})
read(5, \374\17\0\7, 4)   = 4
select(6, [5], NULL, NULL, {60, 0}) = 1 (in [5], left {60, 0})
read(5, \1\0\0\0, 4)  = 4
open($NtServicePackUninstall$/2jl3vz7j.zip, O_RDONLY|O_LARGEFILE) = -1 
ENOENT (No such file or directory)
gettimeofday({1058644307, 137041}, NULL) = 0
getpid()= 3341
open($NtServicePackUninstall$/.2jl3vz7j.zip.dt2mgM, 
O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) = 3
fchmod(3, 0700) = 0
write(1, $NtServicePackUninstall$/2jl3vz7..., 38) = 38
select(6, [5], NULL, NULL, {60, 0}) = 1 (in [5], left {60, 0})
read(5, \0\0\0\0, 4)  = 4
select(6, [5], NULL, NULL, {60, 0}) = 1 (in [5], left {60, 0})
read(5, \274\2\0\0, 4)= 4
select(6, [5], NULL, NULL, {60, 0}) = 1 (in [5], left {60, 0})
read(5, \0\0\0\0, 4)  = 4
select(6, [5], NULL, NULL, {60, 0}) = 1 (in [5], left {60, 0})
read(5, \315*\0\0, 4) = 4
select(6, [5], NULL, NULL, {60, 0}) = 1 (in [5], left {60, 0})
read(5, PK\3\4\n\0\0\0\0\0\363i\374\:7\213U\367\0\0\0\367\0\0..., 
4072) = 4072
select(6, [5], NULL, NULL, {60, 0}) = 1 (in [5], left {60, 0})
read(5, \374\17\0\7, 4)   = 4
select(6, [5], NULL, NULL, {60, 0}) = 1 (in [5], left {60, 0})
read(5,