I like the built-in idea as I don't happen to use rsync via inetd/xinetd
or any other on-demand starter.
It's not an actual problem for me, today, but that's no excuse to avoid
doing the right thing once you recognize it.
--
bkw
On 5/31/2011 1:15 AM, samba-b...@samba.org wrote:
https://bugzilla.samba.org/show_bug.cgi?id=8188
--- Comment #1 from Wayne Davison<way...@samba.org> 2011-05-31 05:15:51 UTC ---
You could just setup something to echo a one-line message on the socket and
disconnect. If you're using xinetd, tweak the program to be anything that
outputs a message to stdout. To replace an rsync daemon, you may want to code
up a C program or use a simple perl script, like this (and run it instead of
the daemon):
#!/usr/bin/perl
use strict;
use warnings;
use Socket;
my $PORT = 873;
local *S;
socket(S, PF_INET, SOCK_STREAM , getprotobyname('tcp'))
or die "couldn't open socket: $!\n";
setsockopt(S, SOL_SOCKET, SO_REUSEADDR, 1);
bind(S, sockaddr_in($PORT, INADDR_ANY));
listen(S, 25) or die "listen failed: $!\n";
while (1) {
accept(CON, S);
print CON "The rsync server is down for maintenance.\n";
close CON;
}
Any connecting rsync will then output this:
rsync: server sent "The rsync server is down for maintenance." rather than
greeting
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html