problem syncing files on RAM in embedded device

Vijay Ram.C cvijay at banyannetworks.com
Fri Jun 10 12:28:20 GMT 2005


Hi all,

i am working on an networking product which has  a 32 MB flash memory 
and a 64MB RAM.
i need to sync a file named appl.gz which is of size 3.1MB from a unit 
with ip 192.168.10.1 to a unit with ip 192.168.10.2.
the rsync is called from a C code which does a fork-execve operation.
the command line options being passed to rsync is as below:

command: rsync --stats -aI --temp-dir=/tmp/  192.168.10.1::path/appl.gz 
/config/appl.gz

in the above command tmp/ is a part of the filesystem on the RAM space 
while /config/ is mounted onto a flash space.
the above operation is done in two phases. one is a direct function call 
which does the above operation and the second  is  in a
while loop which keeps doing the operation every one hour. For  first 
phase an error is thrown as below.

write failed on appl.gz: Success
unexpected EOF in read_timeout

after giving the above error the, syncing of files terminates.
 From the second phase onwards,  the syncing of the same file with the 
same options as given above works well.
On experimenting, the same code worked well when done with the 
--temp-dir=/config/ i.e, temporary redirected to flash ie, where the 
destination is to be present.
The platform being used in the product is monta vista linux and. i have 
compiled the source code of version 2.4.8 and ported on the device.
there is also enough space on the flash  as well as the RAM for the temp 
file to be made.
I read in some old mails in the mailing list which said that this error 
comes when there is no data on the socket. But on certain experimentation,
i tried syncing another file of size less that 512KB instead of the 
above mentioned file. At that time everything went well and the syncing
was successfull. The main reason for me going with this old version of 
rsync is the space taken by the rsync binary.
Can anybody help me figure out the reason for the failure on the first 
go.Is there any extra care that should be taken which am missing when 
redirecting temporary file to RAM space??
Any help  is welcomed.

Regards,
Vijay Ram.C




More information about the rsync mailing list