Your message dated Mon, 18 May 2026 15:08:35 +0000
with message-id <[email protected]>
and subject line Paraphrasing and closing
has caused the Debian Bug report #212341,
regarding rsync: Making streaming easier.
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
212341: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=212341
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: rsync
Version: 2.5.6-0.1
Severity: wishlist
Hi,
As far a I know, there is no other program other than rsync that can
access rsync servers.
Making it easier to use the existing rsync program programaticaly to
access rsync servers from other applications would be quite useful.
There are two approaches that I can think of:
1) Allow specifying the temp file's name for single file transfers. If
that was possible, hacking around it to get the desired effect would
be even easy.
2) Adding --stream-to-fd parameter, so all file data gets also written
to the specified fd. That would allow the streaming while letting
rsync work normally.
For instance, this is an LD_PRELOADable library that did the trick for
me while coding apt-proxy v2:
-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <stdlib.h>
static int fd_err = -1;
static FILE *debug;
void _init(void)
{
debug=stderr;
/* Make sure that nothing gets spit to stdout */
stdout = stderr;
/* save a file descriptor for stderr because rsync seams to close it
* at the and I want to write some debuging messages */
fd_err = dup(2);
fprintf(debug, "starting\n");
}
void _fini(void)
{
fprintf(debug, "ending\n");
}
int mkstemp(char *template)
{
fprintf(debug, "file_template: %s\n", template);
open(template, O_RDWR|O_CREAT, 0600);
return 1;
}
int mkstemp64(char *template)
{
return mkstemp(template);
}
int rename(const char *oldpath, const char *newpath)
{
dup2(fd_err, 2);
fprintf(debug, "newpath: %s\n", newpath);
if(strstr(oldpath, "XXXXXX")) {
char command[300] = "touch -r ";
fprintf(debug, "removeing %s\n", oldpath);
/* rsync changes the mtime on the temporal file, so use that
* to touch owr file */
snprintf(command, sizeof(command), "touch -r %s %s",
oldpath, newpath);
system(command);
return unlink(oldpath);
} else{
fprintf(debug, "renaiming %s\n\n", oldpath);
return syscall(SYS_rename, oldpath, newpath);
}
}
-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----
Thanks for maintaining rsync
Manuel
-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux hell 2.4.21-dm-debian #3 Sun Aug 17 03:33:36 CEST 2003 i686
Locale: LANG=C, LC_CTYPE=es_ES
Versions of packages rsync depends on:
ii libc6 2.3.2-8 GNU C Library: Shared libraries an
ii libpopt0 1.7-2 lib for parsing cmdline parameters
-- no debconf information
--
--- Manuel Estrada Sainz <[email protected]>
<[email protected]>
<[email protected]>
------------------------ <[email protected]> -------------------
Let us have the serenity to accept the things we cannot change, courage to
change the things we can, and wisdom to know the difference.
--- End Message ---
--- Begin Message ---
Hello Manual,
your report is quit old, but please let me know if you find a solution
or want to add some new information to this.
In my understanding, you would like to use rsync programmatically as a
streaming data source for rsync servers? And not only as a file-oriented
sync. You want a way to access transferred
file data directly from another application without relying on rsync's
temporary-file and rename workflow? Am I right so far?
It seems hacky to me. And IMHO this is not the use case rsync was
invented for. On the other hand, I have to say it is quit an interesting
and artistic idea.
I see now way how to implement this in a clean and non-fragil way. If
you are still interested in this I would suggest you to contact the
upstream project on their mailinglist
https://lists.samba.org/mailman/listinfo/rsync .
Regards,
Christian
not a bug
--- End Message ---