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