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

2011-06-06 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=8188

--- Comment #8 from Brian K. White  2011-06-06 15:36:52 UTC ---
(In reply to comment #6)
> I've committed a change to 3.1.0dev git that allows a pre-xfer exec script to
> send an error message to go with its non-zero exit status.  This will allow
> someone to tweak their rsyncd.conf file to add a global option like the
> following (assuming that they don't override pre-xfer exec elsewhere):
> 
> pre-xfer exec = /usr/local/bin/output-rsyncd-downtime-message
> 
> That script may output a message to stdout and then exit with a non-zero
> status.
> 
> You could also choose to leave the pre-xfer exec configured, and make the
> script do your file-check:
> 
> #!/bin/sh
> if [ -f /rsyncd.downtime ]; then
> cat /rsyncd.downtime
> exit 1
> fi

Sometimes, you ask for an inch, they give you a mile. ;)

-- 
bkw

-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
-- 
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


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

2011-06-05 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=8188

--- Comment #7 from Andrew Pollock  
2011-06-05 16:24:01 UTC ---
(In reply to comment #6)
> I've committed a change to 3.1.0dev git that allows a pre-xfer exec script to
> send an error message to go with its non-zero exit status.  This will allow
> someone to tweak their rsyncd.conf file to add a global option like the
> following (assuming that they don't override pre-xfer exec elsewhere):
> 
> pre-xfer exec = /usr/local/bin/output-rsyncd-downtime-message
> 
> That script may output a message to stdout and then exit with a non-zero
> status.
> 
> You could also choose to leave the pre-xfer exec configured, and make the
> script do your file-check:
> 
> #!/bin/sh
> if [ -f /rsyncd.downtime ]; then
> cat /rsyncd.downtime
> exit 1
> fi

Sweet! Thanks!

-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
-- 
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


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

2011-06-04 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=8188

Wayne Davison  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
Version|3.0.8   |3.1.0
 Resolution||FIXED

--- Comment #6 from Wayne Davison  2011-06-04 19:00:14 UTC ---
I've committed a change to 3.1.0dev git that allows a pre-xfer exec script to
send an error message to go with its non-zero exit status.  This will allow
someone to tweak their rsyncd.conf file to add a global option like the
following (assuming that they don't override pre-xfer exec elsewhere):

pre-xfer exec = /usr/local/bin/output-rsyncd-downtime-message

That script may output a message to stdout and then exit with a non-zero
status.

You could also choose to leave the pre-xfer exec configured, and make the
script do your file-check:

#!/bin/sh
if [ -f /rsyncd.downtime ]; then
cat /rsyncd.downtime
exit 1
fi

-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
-- 
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


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

2011-06-02 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=8188

--- Comment #5 from Andrew Pollock  
2011-06-03 03:56:14 UTC ---
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #1)
> > 
> > That's very cute, but not quite what I had in mind.
> > 
> > I just attached a proof of concept patch that I surprised myself by being 
> > able
> > to hack together the other night.
> > 
> > The real thing probably needs to be configurable, and it'd probably be 
> > better
> > to get the message from the contents of the file (if there was any).
> 
> Someone else emailed me an untested idea to just use exclude file and
> place/remove/edit the exclude file to toggle the access.
> 
> That doesn't provide the truly graceful/informative response code or message,
> but:
> * toggles the access
> * avoids downing the service even momentarily
> * potentially avoids requiring a host admin to even do anything, since a user
> may have permission to place/remove the exclude file
> * it's at least distinct from failed to connect
> * uses already existing features
> * does not require any, let alone two different, wrapper layers in the form of
> the perl (or other) wrapper script and (x)inetd to run it.
> 
> I haven't finished playing around with that to see just how close that can 
> come
> to the desired fully graceful process but I felt it should be mentioned as
> another workaround option.

The same could be said for my "patch". If the file that is checked is
configurable, and the contents of the file are used to obtain the message, then
it also

* toggles the access
* avoids downing the service even momentarily
* can potentially avoid the host admin having to do anything if the file is in
a user-writable location (I personally don't consider this to be a desirable
feature)
* doesn't require wrappers

I'm prepared to continue futzing around with my patch if it has merit, I'm just
not a very competent C programmer.

-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
-- 
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


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

2011-06-02 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=8188

--- Comment #4 from Brian K. White  2011-06-02 21:47:32 UTC ---
(In reply to comment #3)
> (In reply to comment #1)
> 
> That's very cute, but not quite what I had in mind.
> 
> I just attached a proof of concept patch that I surprised myself by being able
> to hack together the other night.
> 
> The real thing probably needs to be configurable, and it'd probably be better
> to get the message from the contents of the file (if there was any).

Someone else emailed me an untested idea to just use exclude file and
place/remove/edit the exclude file to toggle the access.

That doesn't provide the truly graceful/informative response code or message,
but:
* toggles the access
* avoids downing the service even momentarily
* potentially avoids requiring a host admin to even do anything, since a user
may have permission to place/remove the exclude file
* it's at least distinct from failed to connect
* uses already existing features
* does not require any, let alone two different, wrapper layers in the form of
the perl (or other) wrapper script and (x)inetd to run it.

I haven't finished playing around with that to see just how close that can come
to the desired fully graceful process but I felt it should be mentioned as
another workaround option.

-- 
bkw

-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
-- 
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


RFE blues (Re: [Bug 8188] Mechanism for taking an rsync server down for maintenance)

2011-06-02 Thread Matt McCutchen
On Wed, 2011-06-01 at 17:08 -0400, Brian K. White wrote:
> On 6/1/2011 3:26 PM, Matt McCutchen wrote:
> > On Wed, 2011-06-01 at 14:57 -0400, Brian K. White wrote:
> >> 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.
> >
> > And "the right thing" for upstream rsync is in Wayne's sole discretion.
> > In my view, the perl script is a fine solution and what convenience
> > there may be in a built-in option does not merit the effort of
> > maintaining the feature as part of rsync.
> >
> 
> That is a work-around, not a solution.

The difference between the two is a matter of opinion.  I don't share
yours.

> The work-around requires using (x)inetd

This is not true of the program in comment 1.

> If the service aims to be usable stand-alone, which rsync clearly does, 
> then imo this is just part of that. A nicity perhaps, not critical, but 
> trivial to implement and maintain in comparison with things like 
> child/session management which are definitely in there solely to support 
> standalone daemon operation.

Right.  Feel free to maintain an enhanced version of rsync with every
proposed feature that is straightforward to maintain in isolation and
potentially helpful to rsync's mission, and if you do a good enough job
the distros will surely adopt it.  Wayne will maintain what he judges is
worthwhile; you should not expect him to do otherwise, unless you hire
him.

-- 
Matt

-- 
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


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

2011-06-01 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=8188

--- Comment #3 from Andrew Pollock  
2011-06-02 04:36:12 UTC ---
(In reply to comment #1)

That's very cute, but not quite what I had in mind.

I just attached a proof of concept patch that I surprised myself by being able
to hack together the other night.

The real thing probably needs to be configurable, and it'd probably be better
to get the message from the contents of the file (if there was any).

-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
-- 
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


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

2011-06-01 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=8188

--- Comment #2 from Andrew Pollock  
2011-06-02 04:34:54 UTC ---
Created attachment 6513
  --> https://bugzilla.samba.org/attachment.cgi?id=6513
Proof of concept patch

This is purely a proof of concept patch and not production-grade.

-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
-- 
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


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

2011-06-01 Thread Brian K. White

On 6/1/2011 3:26 PM, Matt McCutchen wrote:

On Wed, 2011-06-01 at 14:57 -0400, Brian K. White wrote:

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.


And "the right thing" for upstream rsync is in Wayne's sole discretion.
In my view, the perl script is a fine solution and what convenience
there may be in a built-in option does not merit the effort of
maintaining the feature as part of rsync.



That is a work-around, not a solution. It's great in that, if you can 
meet it's requirements and live with it's deficiencies, it's something 
you can usually do right now without needing anyone else to fix or 
enhance anything. It's also great in that, probably most people _can_ 
meet the requirements and live with the deficiencies since they are not 
that much.


The work-around requires using (x)inetd, and there are many and various 
reasons, from mere admin flexibility, to performance, to security, for 
wanting to avoid all use of any inetd, and why rsync and many other 
servers offer the ability to handle their sessions themselves.


If the service aims to be usable stand-alone, which rsync clearly does, 
then imo this is just part of that. A nicity perhaps, not critical, but 
trivial to implement and maintain in comparison with things like 
child/session management which are definitely in there solely to support 
standalone daemon operation.


Not every such service incorporates such a feature, but the provided 
common examples of proftpd and apache that do provide that feature 
pretty well express that, and why, it is wanted in a stand-alone daemon 
if it is to ever be heavily used, especially in a public context.


To argue against it very strongly is essentially to say "Nah, we don't 
care if rsync is really good for heavy and/or public use."
Given the other features that have been there since day one, and that 
still go in daily, I extremely doubt that.


Come to think of it, this would matter to me a lot I just realized, as a 
client.
I have a devil of a time maintaining my opensuse install repo mirrors 
because the server has no proper way to tell me not to sync right now 
because it's in the process of being updated itself at the moment.


There are other problems too, relating to the difference between "This 
directory was deleted from the source and so you DO want to delete it in 
your mirror.", vs "This directory was removed only because the entire 
tree was removed because we are no longer supporting this old version of 
the distribution, you probably do NOT want to delete it from your 
private copy just because we removed it from our public site."
That second problem is arguable both ways as being something rsync 
should provide an answer for, or not. It's easy to say why not. But 
what's the point of writing rsync? So people _won't_ use it?


--
bkw
--
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


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

2011-06-01 Thread Matt McCutchen
On Wed, 2011-06-01 at 14:57 -0400, Brian K. White wrote:
> 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.

And "the right thing" for upstream rsync is in Wayne's sole discretion.
In my view, the perl script is a fine solution and what convenience
there may be in a built-in option does not merit the effort of
maintaining the feature as part of rsync.

-- 
Matt

-- 
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


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

2011-06-01 Thread Brian K. White
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  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


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

2011-05-30 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=8188

--- Comment #1 from Wayne Davison  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

-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
-- 
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