exportfs, srvfs – network file server plumbing
is a user level file server that allows Plan 9 compute servers, rather
than file servers, to export portions of a name space across networks.
The service is started either by the
command or by a network listener process. An initial protocol
establishes a root directory for the exported name space.
is then mounted, typically on
then acts as a relay file server: operations in the imported file
tree are executed on the remote server and the results returned. This
gives the appearance of exporting a name space from a remote machine
into a local file tree.
The options are:
Use the network
if requested by the initial protocol.
Authenticate the user with the
protocol before running the regular
session; used when
is invoked to handle an incoming network connection.
creates a new name space for each connection, using
by default (see
authenticate as a
client, and then
serve that network connection.
Requires setting the root of the name space with
The remote system should run
to handle the call.
for an example.
-d -f dbgfile
Log all 9P traffic to
-e ’enc auth’
Set the encryption and authentication algorithms to use for
encrypting the wire traffic (see
The defaults are
Set the maximum message size that
should offer to send (see
this helps tunneled
9P connections to avoid unnecessary fragmentation.
Serve the name space described by
Disallow mounts by user
Restrict the set of exported files.
contains one regular expression per line,
to be matched against path names
relative to the current working directory
and starting with
For a file to be exported, all lines with a prefix
must match and all those with prefix
must not match.
Make the served name space read only.
Bypass the initial protocol, serving the name space rooted at
bypass the initial protocol, serving the result of mounting
A separate mount is used for each
to correctly handle servers in which each mount
corresponds to a different client
kept for compatibility.
to serve device files in the terminal. The
on a remote machine, permitting users to access arbitrary pieces of
name space on other systems.
Because the kernel disallows reads and writes on mounted pipes
(as might be found in
calls itself (with appropriate
options) to simulate reads and writes on such files.
to create a mountable file system from a name space
and posts it at
which is created with mode
The name space is the directory tree rooted at
options, if present, are relayed to
To export the archive of one user for one month, except for secrets,
echo '+ ^/(2003(/10..(/usr(/glenda/?)?)?)?)?' > /tmp/pattern
echo '- \.(aes|pgp)$' >> /tmp/pattern
exportfs -P /tmp/pattern
to enable mounting of an FTP file system (see
in several windows,
or to publish a
with a broken process so a remote person may debug the program:
srvfs ftp /n/ftp
srvfs broke /mnt/term/proc
to obtain a copy of a service to be manipulated directly
by a user program like
srvfs nfs.boot /srv/boot
aux/nfsserver -f /srv/nfs.boot
to spy on all accesses to a particular subtree:
srvfs -d spy /
tail -f /tmp/exportdb &
mount /srv/spy /n/spy
cd /n/spy; ls