ypbind/ypbind-rebind.patch

122 lines
5.2 KiB
Diff

diff -up ypbind-mt-1.36/man/ypbind.8.rebind ypbind-mt-1.36/man/ypbind.8
--- ypbind-mt-1.36/man/ypbind.8.rebind 2013-01-29 14:02:15.806838768 +0100
+++ ypbind-mt-1.36/man/ypbind.8 2013-01-29 14:02:15.810838767 +0100
@@ -171,7 +171,7 @@ ypbind \- NIS binding process
.SH "Synopsis"
.fam C
.HP \w'\fBypbind\fR\ 'u
-\fBypbind\fR [\-c] [\-d | \-debug] [\-verbose] [\-n | \-forground] [\-broadcast] [\-broken\-server] [\-ypset] [\-ypsetme] [\-no\-ping] [\-f\ \fIconfigfile\fR] [\-local\-only] [\-ping\-interval\ \fIping\-interval\fR] [\-no\-dbus]
+\fBypbind\fR [\-c] [\-d | \-debug] [\-verbose] [\-n | \-forground] [\-broadcast] [\-broken\-server] [\-ypset] [\-ypsetme] [\-no\-ping] [\-f\ \fIconfigfile\fR] [\-local\-only] [\-ping\-interval\ \fIping\-interval\fR] [\-rebind\-interval\fR] [\-no\-dbus]
.fam
.fam C
.HP \w'\fBypbind\fR\ 'u
@@ -370,6 +370,13 @@ The default value for
to check, if a NIS server is still reachable, is 20 seconds\&. With this options another frequency in seconds can be specified\&.
.RE
.PP
+\fB\-rebind\-interval\fR
+.RS 4
+The default value for
+\fBypbind\fR
+to search for the fastest NIS server is 900 seconds (15 minutes)\&. With this options another frequency in seconds can be specified\&.
+.RE
+.PP
\fB\-no\-dbus\fR
.RS 4
Disables DBUS support if compiled in\&.
diff -up ypbind-mt-1.36/man/ypbind.8.xml.rebind ypbind-mt-1.36/man/ypbind.8.xml
--- ypbind-mt-1.36/man/ypbind.8.xml.rebind 2013-01-29 14:02:15.802838768 +0100
+++ ypbind-mt-1.36/man/ypbind.8.xml 2013-01-29 14:02:15.810838767 +0100
@@ -51,6 +51,7 @@
<arg choice='opt'>-f <replaceable>configfile</replaceable></arg>
<arg choice='opt'>-local-only </arg>
<arg choice='opt'>-ping-interval <replaceable>ping-interval</replaceable></arg>
+ <arg choice='opt'>-rebind-interval</arg>
<arg choice='opt'>-no-dbus </arg>
</cmdsynopsis>
<cmdsynopsis>
@@ -273,6 +274,15 @@ to check, if a NIS server is still reach
With this options another frequency in seconds can be specified.</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>-rebind-interval</option></term>
+ <listitem>
+<para>The default value for
+<command>ypbind</command>
+to search for the fastest NIS server is 900 seconds (15 minutes).
+With this options another frequency in seconds can be specified.</para>
+ </listitem>
+ </varlistentry>
<varlistentry>
<term><option>-no-dbus</option></term>
<listitem>
diff -up ypbind-mt-1.36/src/local.h.rebind ypbind-mt-1.36/src/local.h
--- ypbind-mt-1.36/src/local.h.rebind 2012-07-11 14:02:46.000000000 +0200
+++ ypbind-mt-1.36/src/local.h 2013-01-29 14:02:15.810838767 +0100
@@ -9,6 +9,7 @@ extern int ping_interval;
extern int use_broadcast;
extern int localhost_used;
extern char *domain;
+extern int rebind_interval;
extern void find_domain (const char *domain, ypbind_resp *result);
extern void clear_server (void);
diff -up ypbind-mt-1.36/src/serv_list.c.rebind ypbind-mt-1.36/src/serv_list.c
--- ypbind-mt-1.36/src/serv_list.c.rebind 2013-01-29 14:02:15.799838768 +0100
+++ ypbind-mt-1.36/src/serv_list.c 2013-01-29 14:02:15.810838767 +0100
@@ -1145,7 +1145,7 @@ test_bindings (void *param __attribute__
pthread_exit (&success);
lastcheck += ping_interval;
- if (lastcheck >= 900) /* 900 = 15min. */
+ if (lastcheck >= rebind_interval) /* default 900 = 15min. */
lastcheck = 0;
#if USE_DBUS_NM
diff -up ypbind-mt-1.36/src/ypbind-mt.c.rebind ypbind-mt-1.36/src/ypbind-mt.c
--- ypbind-mt-1.36/src/ypbind-mt.c.rebind 2013-01-29 14:02:15.808838768 +0100
+++ ypbind-mt-1.36/src/ypbind-mt.c 2013-01-29 14:02:15.811838767 +0100
@@ -79,6 +79,7 @@ int ping_interval = 20;
int local_only = 0;
int localhost_used = 1;
int port = -1;
+int rebind_interval = 900; /* 900 = 15min. */
static int lock_fd;
static int pid_is_written = 0;
static pthread_mutex_t mutex_pid = PTHREAD_MUTEX_INITIALIZER;
@@ -512,7 +513,7 @@ usage (int ret)
output = stdout;
fputs (_("Usage:\n"), output);
- fputs (_("\typbind [-broadcast | -ypset | -ypsetme] [-f configfile]\n\t [-no-ping] [-broken-server] [-local-only] [-i ping-interval] [-debug]\n\t [-verbose] [-n | -foreground]\n"), output);
+ fputs (_("\typbind [-broadcast | -ypset | -ypsetme] [-f configfile]\n\t [-no-ping] [-broken-server] [-local-only] [-i ping-interval]\n\t [-r rebind-interval] [-debug] [-verbose] [-n | -foreground]\n"), output);
#ifdef USE_DBUS_NM
fputs (_("\t [-no-dbus]\n"), output);
#endif
@@ -750,6 +751,16 @@ main (int argc, char **argv)
else if (strcmp ("-no-dbus", argv[i]) == 0)
disable_dbus = 1;
#endif
+ else if (strcmp ("-rebind-interval", argv[i]) == 0 ||
+ strcmp ("-r", argv[i]) == 0)
+ {
+ if (i+1 == argc || argv[i+1][0] == '-')
+ usage (1);
+ ++i;
+ rebind_interval = atoi (argv[i]);
+ if (rebind_interval < 1)
+ usage (1);
+ }
else if (strcmp ("--help", argv[i]) == 0)
usage (0);
else
@@ -841,6 +852,7 @@ main (int argc, char **argv)
{
log_msg (LOG_DEBUG, "[Welcome to ypbind-mt, version %s]\n", VERSION);
log_msg (LOG_DEBUG, "ping interval is %d seconds\n", ping_interval);
+ log_msg (LOG_DEBUG, "rebind interval is %d seconds\n", rebind_interval);
}
else if (! foreground_flag)
{