shithub: riscv

ref: 0e09795831f37b86206e4dc9b3a0ac8bcd90401e
dir: /sys/man/4/srv/

View raw version
.TH SRV 4 
.SH NAME
srv, srvssh, 9fs \- start network file service
.SH SYNOPSIS
.B srv
[
.B -abcCemnNq
] [
.B -s
.I seconds
]
.RI [ net !] system\c
.RI [! service ]
[
.I srvname
[
.I mtpt
] ]
.PP
.B srvssh
[
.B -r
]
[
.B -R
]
[
.B -s
]
[
.B -u
.I u9fspath
]
.I system
[
.I srvname
[
.I mtpt
] ]
.PP
.B 9fs
.RI [ net !] system
.RI [ mountpoint ]
.SH DESCRIPTION
.I Srv
dials the given machine and initializes the connection to serve the
9P protocol.
By default, it connects to the
.L 9fs
(9P)
service, which for TCP is port 564.
It then creates in
.B /srv
a file named
.IR srvname .
Users can then
.B mount
(see
.IR bind (1))
the service, typically on a name in
.BR /n ,
to access the files provided by the remote machine.
If
.I srvname
is omitted, the first argument to
.I srv
is used.
Option
.B m
directs
.I srv
to mount the service on
.BI /n/ system
or onto
.I mtpt
if it is given.
Option
.B q
suppresses complaints if the
.B /srv
file already exists.
The 
.BR a ,
.BR b ,
.BR c ,
.BR C ,
and
.BR n ,
.B N
options are used to control the mount flags as in
.I mount
(see
.IR bind (1)).
The
.B e
option causes
.I srv
to treat
.I system
as a shell command to be executed rather than
an address to be dialed.
The
.B s
option causes
.I srv
to sleep for the specified number of seconds
after establishing the connection
before posting and mounting it.
This is sometimes needed by
.IR srvssh .
.PP
The specified
.I service
must serve 9P.  Usually
.I service
can be omitted; when calling some
non-Plan-9 systems, a
.I service
such as
.B u9fs
must be mentioned explicitly.
.PP
The
.I 9fs
command does the
.I srv
and the
.I mount
necessary to make available the files of
.I system
on network
.IR net .
The files are mounted on
.IR mountpoint ,
if given;
otherwise they are mounted on
.BI /n/ system\f1.
If
.I system
contains
.L /
characters, only the last element of
.I system
is used in the
.B /n
name.
.PP
.I 9fs
recognizes some special names, such as
.B dump
to make the dump file system available on
.BR /n/dump .
.I 9fs
is an
.IR rc (1)
script; examine it to see what local conventions apply.
.PP
.I Srvssh
is an
.IR rc (1)
command that
connects to a remote Unix system via 
.IR ssh (1)
and starts
.IR u9fs (4).
The
.B -u
option specifies the path to the
.B u9fs
binary on the remote system.
(By default, an unrooted path of
.B u9fs
is used; if the binary is in the path of
the remote SSH server, you don't need the
.B -u
option.)
For information about the other options,
see the introductory comment in
.BR /rc/bin/srvssh .
The arguments are the same as
.IR srv .
.SH EXAMPLES
To see kremvax's and deepthought's files in
.B /n/kremvax
and
.BR /n/deepthought :
.IP
.EX
9fs kremvax
9fs hhgttg /n/deepthought
.EE
.PP
To connect to an instance of the Unix server
.IR u9fs (4)
started via
.IR ssh (1):
.IP
.EX
srvssh unix
.EE
.SH FILES
.TF /srv/*
.TP
.B /srv/*
ports to file systems and servers posted by
.I srv
and
.I 9fs
.SH SOURCE
.B /sys/src/cmd/srv.c
.br
.B /rc/bin/9fs
.br
.B /rc/bin/srvssh
.SH "SEE ALSO"
.IR bind (1),
.IR auth (2),
.IR dial (2),
.IR srv (3),
.IR exportfs (4),
.IR import (4),
.IR ftpfs (4),
.IR u9fs (4)
.SH BUGS
.I Srv
does not explicitly report failures of
.I auth_proxy
(see
.IR auth (2));
.I mount
(see
.IR bind (1))
does.