[Bug 8188] Mechanism for taking an rsync server down for maintenance

Brian K. White brian at aljex.com
Wed Jun 1 12:57:55 MDT 2011


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-bugs at samba.org wrote:
> https://bugzilla.samba.org/show_bug.cgi?id=8188
>
> --- Comment #1 from Wayne Davison<wayned at 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
>



More information about the rsync mailing list