Re: [PATCH] allow to disable SLP with runtime option

2009-04-28 Thread Petr Uzel
On Mon, Apr 27, 2009 at 08:47:40AM -0700, Wayne Davison wrote:
 On Wed, Apr 22, 2009 at 04:14:23PM +0200, Petr Uzel wrote:
  It adds a new global boolean option, 'disable slp', which can be used
  to disable SLP advertisements at runtime.
 
 I've taken your patch and changed the boolean into a use slp global
 daemon parameter (default: enabled).  I also made sure that if slp is
 disabled, that there is no slp timeout processing (or services could get
 enabled at the first timeout).  The updated slp patch is now in git.
 
 Thanks!

Hi Wayne,
thanks for accepting the patch.

I wanted to see changes you've made, but I can't figure out how to
'git clone' the patches repository. And on gitweb, I don't see any
changes.

Could you please help me?


Thanks in advance,


-- 
Best regards / s pozdravem

Petr Uzel, Packages maintainer
-
SUSE LINUX, s.r.o.  e-mail: pu...@suse.cz
Lihovarská 1060/12  tel: +420 284 028 964
190 00 Prague 9 fax: +420 284 028 951
Czech Republic  http://www.suse.cz
-- 
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: [PATCH] allow to disable SLP with runtime option

2009-04-28 Thread Wayne Davison
On Tue, Apr 28, 2009 at 10:00:21AM +0200, Petr Uzel wrote:
 I wanted to see changes you've made, but I can't figure out how to
 'git clone' the patches repository.

Samba doesn't allow cloning of the patches repo at this time, but it's
something I hope to get fixed before too long.  To view patches, go to
the download page and look for the patches section.

 http://rsync.samba.org/download.html

..wayne..
-- 
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: [PATCH] allow to disable SLP with runtime option

2009-04-27 Thread Wayne Davison
On Wed, Apr 22, 2009 at 04:14:23PM +0200, Petr Uzel wrote:
 It adds a new global boolean option, 'disable slp', which can be used
 to disable SLP advertisements at runtime.

I've taken your patch and changed the boolean into a use slp global
daemon parameter (default: enabled).  I also made sure that if slp is
disabled, that there is no slp timeout processing (or services could get
enabled at the first timeout).  The updated slp patch is now in git.

Thanks!

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


[PATCH] allow to disable SLP with runtime option

2009-04-22 Thread Petr Uzel
Hi everyone,

I'd like to propose a patch for review. It enhances rsync when
patched and compiled with slp support.

It adds a new global boolean option, 'disable slp', which can be used to disable
SLP advertisements at runtime. The idea behind this patch is to allow
distributors to build rsync with SLP support compiled in, but to allow
the users to turn it off without recompiling rsync on their own.


The patch applies to rsync-3.0.6pre1 with slp.diff applied.


I'd highly appreciate any feedback.



Index: rsync-3.0.6pre1/loadparm.c
===
--- rsync-3.0.6pre1.orig/loadparm.c 2009-04-22 12:47:39.0 +0200
+++ rsync-3.0.6pre1/loadparm.c  2009-04-22 13:30:39.0 +0200
@@ -111,6 +111,7 @@ typedef struct
int rsync_port;
 #ifdef HAVE_LIBSLP
int slp_refresh;
+   BOOL disable_slp;
 #endif
 } global;
 
@@ -305,6 +306,7 @@ static struct parm_struct parm_table[] =
  {port,  P_INTEGER,P_GLOBAL,Globals.rsync_port, NULL,0},
 #ifdef HAVE_LIBSLP
  {slp refresh,   P_INTEGER,P_GLOBAL,Globals.slp_refresh,NULL,0},
+ {disable slp,P_BOOL,   P_GLOBAL,Globals.disable_slp,
NULL,0},
 #endif
  {socket options,P_STRING, P_GLOBAL,Globals.socket_options, NULL,0},
 
@@ -402,6 +404,7 @@ FN_GLOBAL_STRING(lp_socket_options, Glo
 FN_GLOBAL_INTEGER(lp_rsync_port, Globals.rsync_port)
 #ifdef HAVE_LIBSLP
 FN_GLOBAL_INTEGER(lp_slp_refresh, Globals.slp_refresh)
+FN_GLOBAL_BOOL(lp_disable_slp, Globals.disable_slp)
 #endif
 
 FN_LOCAL_STRING(lp_auth_users, auth_users)
Index: rsync-3.0.6pre1/clientserver.c
===
--- rsync-3.0.6pre1.orig/clientserver.c 2009-04-22 12:47:39.0 +0200
+++ rsync-3.0.6pre1/clientserver.c  2009-04-22 13:36:35.0 +0200
@@ -1065,9 +1065,11 @@ int daemon_main(void)
 * local address??? */
 
 #ifdef HAVE_LIBSLP
-   if (register_services()) {
-   rprintf(FINFO,
-   Couldn't register with service discovery protocol, 
continuing anyway\n);
+   if (!lp_disable_slp()) {
+   if (register_services()) {
+   rprintf(FINFO,
+   Couldn't register with service discovery 
protocol, continuing anyway\n);
+   }
}
 #endif
 
Index: rsync-3.0.6pre1/rsyncd.conf.yo
===
--- rsync-3.0.6pre1.orig/rsyncd.conf.yo 2009-04-22 12:47:39.0 +0200
+++ rsync-3.0.6pre1/rsyncd.conf.yo  2009-04-22 15:17:07.0 +0200
@@ -113,6 +113,10 @@ set to more than 65535, then 65535 is us
 Using 3600 (one hour) is a good number if you tend to change your
 configuration.
 
+dit(bf(disable slp)) This parameter is used to turn off service advertisements
+completely, and is only applicable if you have Service Location Protocol
+support compiled in. The default is no.
+
 enddit()
 
 manpagesection(MODULE PARAMETERS)


-- 
Best regards / s pozdravem

Petr Uzel, Packages maintainer
-
SUSE LINUX, s.r.o.  e-mail: pu...@suse.cz
Lihovarská 1060/12  tel: +420 284 028 964
190 00 Prague 9 fax: +420 284 028 951
Czech Republic  http://www.suse.cz
-- 
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