xref: /freebsd/sbin/ggate/ggated/ggated.8 (revision db33c6f3ae9d1231087710068ee4ea5398aacca7)
1.\" Copyright (c) 2004 Pawel Jakub Dawidek <pjd@FreeBSD.org>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd September 8, 2016
26.Dt GGATED 8
27.Os
28.Sh NAME
29.Nm ggated
30.Nd "GEOM Gate network daemon"
31.Sh SYNOPSIS
32.Nm
33.Op Fl h
34.Op Fl n
35.Op Fl v
36.Op Fl a Ar address
37.Op Fl p Ar port
38.Op Fl F Ar pidfile
39.Op Fl R Ar rcvbuf
40.Op Fl S Ar sndbuf
41.Op Ar "exports file"
42.Sh DESCRIPTION
43The
44.Nm
45utility is a network server for the GEOM Gate class.
46It runs on a server machine to service GEOM Gate requests from workers
47placed on a client machine.
48Keep in mind, that connections between
49.Xr ggatec 8
50and
51.Nm
52are not encrypted.
53.Pp
54Available options:
55.Bl -tag -width ".Ar exports\ file"
56.It Fl a Ar address
57Specifies an IP address to bind to.
58.It Fl h
59Print available options.
60.It Fl n
61Do not use
62.Dv TCP_NODELAY
63option on TCP sockets.
64.It Fl p Ar port
65Port on which
66.Nm
67listens for connections.
68Default is 3080.
69.It Fl F Ar pidfile
70PID file that
71.Nm
72uses.
73.It Fl R Ar rcvbuf
74Size of receive buffer to use.
75Default is 131072 (128kB).
76.It Fl S Ar sndbuf
77Size of send buffer to use.
78Default is 131072 (128kB).
79.It Fl v
80Do not fork, run in foreground and print debug information on standard
81output.
82.It Ar "exports file"
83An alternate location for the exports file.
84.El
85.Pp
86The format of an exports file is as follows:
87.Bd -literal -offset indent
881.2.3.4		RO		/dev/cd0
891.2.3.0/24	RW		/tmp/test.img
90hostname	WO		/tmp/image
91hostname	RW,DIRECT	/tmp/direct-image
92hostname	RW,NODIRECT	/tmp/nodirect-image
93.Ed
94.Pp
95The first colunm specifies the ip, network with netmask, or the hostname
96that the export applies to.
97.Pp
98The next column is the access flags that apply to the export
99.Bl -tag -width ".Cm NODIRECT"
100.It Cm RO
101Read-Only the path specified will be exported to the client read only.
102.It Cm WO
103Write-Only the path specified will be exported to the client write only.
104.It Cm RW
105Read-Write the path specified will be exported to the client read-write.
106.It Cm DIRECT
107The path specified will always be opened with O_DIRECT for clients.
108.It Cm NODIRECT
109The path specified will never be opened with O_DIRECT for clients.
110.El
111.Pp
112The final column specifies the path to export.
113.Pp
114Files are opened with the least common flags between the client and the
115server.  A client may request read or write only to a read-write export
116and the server will honor the client request and open the file in the
117requested mode.  A client requesting greater access than permissions listed
118in the file will be rejected.
119.Pp
120DIRECT and NODIRECT are used to coerce the use of the O_DIRECT flag to
121.Xr open 2 when the specified path is opened. If DIRECT is specified the
122path is always opened with O_DIRECT. If NODIRECT is specified the path is
123never opened with O_DIRECT. DIRECT access limits the cache effects of
124IO operaions on the file.  This has the effect of having clients accessing
125exports to not impact the cache of the local machine, however it
126will cause greater IO utilization to the devices on which the files reside.
127.Pp
128If neither is specified the server will use
129the preference specified by the client, with the default to not use O_DIRECT.
130If the client specifies a preference against the server's configuration the
131client preference will be silently ignored.
132.Pp
133.Sh FILES
134.Bl -tag -width ".Pa /var/run/ggated.pid" -compact
135.It Pa /var/run/ggated.pid
136The default location of the
137.Nm
138PID file.
139.El
140.Sh EXIT STATUS
141Exit status is 0 on success, or 1 if the command fails.
142To get details about the failure,
143.Nm
144should be called with the
145.Fl v
146option.
147.Sh EXAMPLES
148Export CD-ROM device, a file, and a file with
149.Dv O_DIRECT
150option:
151.Bd -literal -offset indent
152# echo "1.2.3.0/24 RO /dev/cd0" > /etc/gg.exports
153# echo "client RW /image" >> /etc/gg.exports
154# echo "client RW,DIRECT /image2" >> /etc/gg.exports
155# echo "client RW,NODIRECT /image3" >> /etc/gg.exports
156# ggated
157.Ed
158.Sh SEE ALSO
159.Xr open 2 ,
160.Xr geom 4 ,
161.Xr ggatec 8 ,
162.Xr ggatel 8
163.Sh HISTORY
164The
165.Nm
166utility appeared in
167.Fx 5.3 .
168.Sh AUTHORS
169The
170.Nm
171utility as well as this manual page was written by
172.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .
173