.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng <steve@ggi-project.org>.
-.TH "NBD-SERVER" "1" "03 January 2009" "" ""
+.TH "NBD-SERVER" "1" "23 May 2009" "" ""
.SH NAME
nbd-server \- serve a file as a block device to other computers running the GNU/Linux(tm) or GNU/Hurd Operating System
.SH SYNOPSIS
-\fBnbd-server \fR \fB\fI[ip:]port\fB\fR \fB\fIfilename\fB\fR [ \fB\fIsize\fB\fR ] [ \fB-r\fR ] [ \fB-m\fR ] [ \fB-c\fR ] [ \fB-a \fItimeout\fB\fR ] [ \fB-l \fIhost list filename\fB\fR ] [ \fB-o \fIsection name\fB\fR ] [ \fB-C \fIconfig file\fB\fR ]
+\fBnbd-server \fR \fB\fI[ip:]port\fB\fR \fB\fIfilename\fB\fR [ \fB\fIsize\fB\fR ] [ \fB-r\fR ] [ \fB-m\fR ] [ \fB-c\fR ] [ \fB-l \fIhost list filename\fB\fR ] [ \fB-o \fIsection name\fB\fR ] [ \fB-C \fIconfig file\fB\fR ]
.SH "DESCRIPTION"
.PP
point \fBnbd-server\fR(1) to a non-existing or
empty configuration file.
.TP
-\fBtimeout\fR
-Maximum number of idle seconds. If a connection is
-inactive for this amount of time, it is terminated; this is to
-avoid stale nbd-server processes staying in memory. Use of
-this option is strongly recommended.
-.TP
\fBhost list filename\fR
This argument should contain a list of IP-addresses
for hosts that may connect to the server. Wildcards are
<arg><option>-r</option></arg>
<arg><option>-m</option></arg>
<arg><option>-c</option></arg>
- <arg><option>-a <replaceable>timeout</replaceable></option></arg>
<arg><option>-l <replaceable>host list filename</replaceable></option></arg>
<arg><option>-o <replaceable>section name</replaceable></option></arg>
<arg><option>-C <replaceable>config file</replaceable></option></arg>
</listitem>
</varlistentry>
<varlistentry>
- <term><option>timeout</option></term>
- <listitem>
- <para>Maximum number of idle seconds. If a connection is
- inactive for this amount of time, it is terminated; this is to
- avoid stale nbd-server processes staying in memory. Use of
- this option is strongly recommended.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
<term><option>host list filename</option></term>
<listitem>
<para>This argument should contain a list of IP-addresses
unsigned int port; /**< port we're exporting this file at */
char* authname; /**< filename of the authorization file */
int flags; /**< flags associated with this exported file */
- unsigned int timeout;/**< how long a connection may be idle
- (0=forever) */
int socket; /**< The socket of this server. */
VIRT_STYLE virtstyle;/**< The style of virtualization, if any */
uint8_t cidrlen; /**< The length of the mask when we use
*/
void usage() {
printf("This is nbd-server version " VERSION "\n");
- printf("Usage: [ip:]port file_to_export [size][kKmM] [-l authorize_file] [-r] [-m] [-c] [-a timeout_sec] [-C configuration file] [-p PID file name] [-o section name]\n"
+ printf("Usage: [ip:]port file_to_export [size][kKmM] [-l authorize_file] [-r] [-m] [-c] [-C configuration file] [-p PID file name] [-o section name]\n"
"\t-r|--read-only\t\tread only\n"
"\t-m|--multi-file\t\tmultiple file\n"
"\t-c|--copy-on-write\tcopy on write\n"
if(serve->authname) {
printf("\tauthfile = %s\n", serve->authname);
}
- if(serve->timeout) {
- printf("\ttimeout = %d\n", serve->timeout);
- }
exit(EXIT_SUCCESS);
}
g_free(serve->authname);
serve->authname=g_strdup(optarg);
break;
- case 'a':
- serve->timeout=strtol(optarg, NULL, 0);
- break;
default:
usage();
exit(EXIT_FAILURE);
{ "exportname", TRUE, PARAM_STRING, NULL, 0 },
{ "port", TRUE, PARAM_INT, NULL, 0 },
{ "authfile", FALSE, PARAM_STRING, NULL, 0 },
- { "timeout", FALSE, PARAM_INT, NULL, 0 },
{ "filesize", FALSE, PARAM_INT, NULL, 0 },
{ "virtstyle", FALSE, PARAM_STRING, NULL, 0 },
{ "prerun", FALSE, PARAM_STRING, NULL, 0 },
lp[0].target=&(s.exportname);
lp[1].target=&(s.port);
lp[2].target=&(s.authname);
- lp[3].target=&(s.timeout);
- lp[4].target=&(s.expected_size);
- lp[5].target=&(virtstyle);
- lp[6].target=&(s.prerun);
- lp[7].target=&(s.postrun);
- lp[8].target=lp[9].target=lp[10].target=
- lp[11].target=lp[12].target=&(s.flags);
- lp[13].target=&(s.listenaddr);
+ lp[3].target=&(s.expected_size);
+ lp[4].target=&(virtstyle);
+ lp[5].target=&(s.prerun);
+ lp[6].target=&(s.postrun);
+ lp[7].target=lp[8].target=lp[9].target=
+ lp[10].target=lp[11].target=&(s.flags);
+ lp[12].target=&(s.listenaddr);
/* After the [generic] group, start parsing exports */
if(i==1) {
i++;
printf("%d: ", i);
#endif
- if (client->server->timeout)
- alarm(client->server->timeout);
readit(client->net, &request, sizeof(request));
request.from = ntohll(request.from);
request.type = ntohl(request.type);