]> git.lizzy.rs Git - plan9front.git/blob - sys/man/4/exportfs
exportfs: revert e524e8d65a7573c46d7beb49e77bfc2d55a5563d
[plan9front.git] / sys / man / 4 / exportfs
1 .TH EXPORTFS 4
2 .SH NAME
3 exportfs, srvfs \- file server plumbing
4 .SH SYNOPSIS
5 .B exportfs
6 [
7 .I options
8 ]
9 .PP
10 .B srvfs
11 [
12 .B -dR
13 ]
14 [
15 .B -p
16 .I perm
17 ]
18 [
19 .B -P
20 .I patternfile
21 ] [
22 .B -e
23 .I exportprog
24 ]
25 .I name
26 .I path
27 .SH DESCRIPTION
28 .I Exportfs
29 is a user level file server that allows Plan 9 cpu servers, rather
30 than file servers, to export portions of a name space.
31 It is usually started by other programs such as
32 .IR rcpu (1)
33 after a secure channel has been established.
34 .I Exportfs
35 then acts as a relay file server: operations in the imported file
36 tree are executed on the remote server and the results returned.  This
37 gives the appearance of exporting a name space from a remote machine
38 into a local file tree.
39 .PP
40 The options are:
41 .TP
42 .B -d -f \fIdbgfile
43 Log all 9P traffic to
44 .I dbgfile
45 (default
46 .BR /tmp/exportdb ).
47 .TP
48 .B -P \fIpatternfile
49 Restrict the set of exported files.
50 .I Patternfile
51 contains one regular expression per line,
52 to be matched against path names
53 relative to the current working directory
54 and starting with
55 .BR / .
56 For a file to be exported, all lines with a prefix
57 .B +
58 must match and all those with prefix
59 .B -
60 must not match.
61 .TP
62 .B -R
63 Make the served name space read only.
64 .TP
65 .B -r \fIroot
66 Serve the name space rooted at
67 .IR root .
68 .TP
69 .B -S \fIservice
70 Serve the result of mounting
71 .IR service .
72 A separate mount is used for each
73 .IR attach (5)
74 message,
75 to correctly handle servers in which each mount
76 corresponds to a different client
77 .IR e.g. , (
78 .IR rio (4)).
79 .TP
80 .B -s
81 equivalent to
82 .B -r
83 .BR / ;
84 kept for compatibility.
85 .TP
86 .B -m \fImsize
87 Set the maximum message size that 
88 .I exportfs
89 should offer to send (see
90 .IR version (5));
91 this helps tunneled
92 9P connections to avoid unnecessary fragmentation.
93 .PD
94 .PP
95 .I Srvfs
96 invokes
97 .I exportprog
98 (default
99 .BR /bin/exportfs )
100 to create a mountable file system from a name space
101 and posts it at
102 .BI /srv/ name ,
103 which is created with mode
104 .I perm
105 (default 0600).
106 The name space is the directory tree rooted at 
107 .IR path .
108 The
109 .BR -d ,
110 .BR -P ,
111 and
112 .B -R
113 options, if present, are relayed to
114 .IR exportprog .
115 .SH EXAMPLES
116 To export the archive of one user for one month, except for secrets,
117 .IP
118 .EX
119 cd /n/dump
120 echo '+ ^/(2003(/10..(/usr(/glenda/?)?)?)?)?' > /tmp/pattern
121 echo '- \e.(aes|pgp)$' >> /tmp/pattern
122 exportfs -P /tmp/pattern
123 .EE
124 .LP
125 Use
126 .I srvfs
127 to enable mounting of an FTP file system (see
128 .IR ftpfs (4))
129 in several windows, 
130 or to publish a
131 .B /proc
132 (see
133 .IR proc (3))
134 with a broken process so a remote person may debug the program:
135 .IP
136 .EX
137 srvfs ftp /n/ftp
138 srvfs broke /mnt/term/proc
139 .EE
140 .LP
141 Use 
142 .I srvfs
143 to obtain a copy of a service to be manipulated directly
144 by a user program like
145 .IR nfsserver (8):
146 .IP
147 .EX
148 srvfs nfs.boot /srv/boot
149 aux/nfsserver -f /srv/nfs.boot
150 .EE
151 .LP
152 Use
153 .I srvfs
154 to spy on all accesses to a particular subtree:
155 .IP
156 .EX
157 srvfs -d spy /
158 tail -f /tmp/exportdb &
159 mount /srv/spy /n/spy
160 cd /n/spy; ls
161 .EE
162 .SH SOURCE
163 .B /sys/src/cmd/exportfs
164 .br
165 .B /sys/src/cmd/srvfs.c
166 .SH SEE ALSO
167 .IR rcpu (1)