xref: /netbsd-src/usr.bin/rump_allserver/rump_allserver.1 (revision cc0b2b0751e960756282725fc9a2cbee3de2d7c7)
1*cc0b2b07Suwe.\"	$NetBSD: rump_allserver.1,v 1.24 2023/04/24 00:07:04 uwe Exp $
278f20aa8Spooka.\"
378f20aa8Spooka.\" Copyright (c) 2010 Antti Kantee.  All rights reserved.
478f20aa8Spooka.\"
578f20aa8Spooka.\" Redistribution and use in source and binary forms, with or without
678f20aa8Spooka.\" modification, are permitted provided that the following conditions
778f20aa8Spooka.\" are met:
878f20aa8Spooka.\" 1. Redistributions of source code must retain the above copyright
978f20aa8Spooka.\"    notice, this list of conditions and the following disclaimer.
1078f20aa8Spooka.\" 2. Redistributions in binary form must reproduce the above copyright
1178f20aa8Spooka.\"    notice, this list of conditions and the following disclaimer in the
1278f20aa8Spooka.\"    documentation and/or other materials provided with the distribution.
1378f20aa8Spooka.\"
1478f20aa8Spooka.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
1578f20aa8Spooka.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1678f20aa8Spooka.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1778f20aa8Spooka.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1878f20aa8Spooka.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1978f20aa8Spooka.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2078f20aa8Spooka.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2178f20aa8Spooka.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2278f20aa8Spooka.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2378f20aa8Spooka.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2478f20aa8Spooka.\" SUCH DAMAGE.
2578f20aa8Spooka.\"
26*cc0b2b07Suwe.Dd April 24, 2023
2778f20aa8Spooka.Dt RUMP_SERVER 1
2878f20aa8Spooka.Os
2978f20aa8Spooka.Sh NAME
3078f20aa8Spooka.Nm rump_server ,
3178f20aa8Spooka.Nm rump_allserver
3278f20aa8Spooka.Nd rump kernel server
3378f20aa8Spooka.Sh SYNOPSIS
3478f20aa8Spooka.Nm
35f46449d4Swiz.Op Fl sv
366fd00c3fSpooka.Op Fl c Ar ncpu
37dbc10b5aSpooka.Op Fl d Ar drivespec
3878f20aa8Spooka.Op Fl l Ar library
3978f20aa8Spooka.Op Fl m Ar module
40a0fb6b68Sozaki-r.Op Fl r Ar total_ram
4178f20aa8Spooka.Ar url
4278f20aa8Spooka.Sh DESCRIPTION
4378f20aa8SpookaThe
4478f20aa8Spooka.Nm
4578f20aa8Spookautility is used to provide a rump kernel service.
4678f20aa8SpookaClients can use the system calls provided by
4778f20aa8Spooka.Nm
4878f20aa8Spookavia
4978f20aa8Spooka.Ar url .
5078f20aa8Spooka.Pp
5178f20aa8SpookaThe difference between
5278f20aa8Spooka.Nm
5378f20aa8Spookaand
5478f20aa8Spooka.Nm rump_allserver
5578f20aa8Spookais that
5678f20aa8Spooka.Nm
5778f20aa8Spookaoffers only a minimalistic set of features,
5878f20aa8Spookawhile
5978f20aa8Spooka.Nm rump_allserver
6078f20aa8Spookaprovides all rump kernel components which were available when the
6178f20aa8Spookasystem was built.
6278f20aa8SpookaAt execution time it is possible to load components from the command
6378f20aa8Spookaline as described in the options section.
64*cc0b2b07Suwe.Bl -tag -width Fl
656fd00c3fSpooka.It Fl c Ar ncpu
666fd00c3fSpookaConfigure
676fd00c3fSpooka.Ar ncpu
686fd00c3fSpookavirtual CPUs on SMP-capable archs.
696fd00c3fSpookaBy default, the number of CPUs equals the number of CPUs on the
706fd00c3fSpookahost.
71dbc10b5aSpooka.It Fl d Ar drivespec
72dbc10b5aSpookaThe argument
73dbc10b5aSpooka.Ar drivespec
7477666f11Spookamaps a host file in the rump kernel fs namespace.
75dbc10b5aSpookaThe string
76dbc10b5aSpooka.Ar drivespec
77dbc10b5aSpookamust be of comma-separated
78*cc0b2b07Suwe.Sm off
79*cc0b2b07Suwe.Ar name\^ Li = Ar value
80*cc0b2b07Suwe.Sm on
81dbc10b5aSpookaformat and must contain the following tokens:
82*cc0b2b07Suwe.
83*cc0b2b07Suwe.Bl -tag -width Ic -offset indent
84*cc0b2b07Suwe.
85*cc0b2b07Suwe.It Ic key
8677666f11SpookaBlock device path in rump kernel namespace.
87dbc10b5aSpookaThis must be specified according to the rules for a key in
88dbc10b5aSpooka.Xr rump_etfs 3 .
89*cc0b2b07Suwe.
90*cc0b2b07Suwe.It Ic hostpath
91dbc10b5aSpookaHost file used for storage.
92dbc10b5aSpookaIf the file does not exist, it will be created.
93dbc10b5aSpooka.El
94*cc0b2b07Suwe.
95ed37916eSpooka.Pp
96aaf2cb63SpookaThe type of file that
97*cc0b2b07Suwe.Ic key
98*cc0b2b07Suweis exposed as within the rump kernel is specified with:
99*cc0b2b07Suwe.
100*cc0b2b07Suwe.Bl -tag -width Ic -offset indent
101*cc0b2b07Suwe.It Ic type
102*cc0b2b07SuwePossible values are
103*cc0b2b07Suwe.Ql blk ,
104*cc0b2b07Suwe.Ql chr ,
105aaf2cb63Spookaand
106*cc0b2b07Suwe.Ql reg
107aaf2cb63Spookafor block device, character device and regular file, respectively.
108*cc0b2b07SuweThe default is a block device
109*cc0b2b07Suwe.Pq Ql blk .
1102c06d51fSpooka.Pp
111*cc0b2b07Suwe.Sy Note :
112*cc0b2b07Suwethe contents of block devices are cached in the rump kernel's
1132c06d51fSpookabuffer cache.
1142c06d51fSpookaTo avoid cache incoherency, it is advisable not to access a file
1152c06d51fSpookathrough the host namespace while it is mapped as a block device in
11672867841Spookaa rump kernel.
117ed37916eSpooka.El
118*cc0b2b07Suwe.
119*cc0b2b07Suwe.Pp
120*cc0b2b07SuweFor block and character devices the
121*cc0b2b07Suwe.Bq Va offset Ns \&,\~ Ns Va offset Ns + Ns Va size
122*cc0b2b07Suweregion of the file must be specified with:
123*cc0b2b07Suwe.
124*cc0b2b07Suwe.Bl -tag -width Ic -offset indent
125*cc0b2b07Suwe.
126*cc0b2b07Suwe.It Ic disklabel
127*cc0b2b07SuweUse a disklabel partition letter to specify the offset and size
128*cc0b2b07Suweof the mapping.
129*cc0b2b07Suwe.Ic hostpath
130*cc0b2b07Suwemust contain a valid disklabel within the first 64k.
131*cc0b2b07Suwe.
132*cc0b2b07Suwe.It Ic offset
133*cc0b2b07SuweOffset of the mapping.
134*cc0b2b07SuweThe default is 0.
135*cc0b2b07Suwe.
136*cc0b2b07Suwe.It Ic size
137*cc0b2b07SuweSize of the mapping.
138*cc0b2b07SuweSimilar to
139*cc0b2b07Suwe.Xr dd 1 ,
140*cc0b2b07Suwethis argument accepts a suffix as the multiplier for the number.
141*cc0b2b07SuweThe special value
142*cc0b2b07Suwe.Ql host
143*cc0b2b07Suweindicates that the current size of
144*cc0b2b07Suwe.Ic hostpath
145*cc0b2b07Suwewill be used.
146*cc0b2b07SuweIn this case it is assumed that
147*cc0b2b07Suwe.Ic hostpath
148*cc0b2b07Suweexists and is a regular file.
149*cc0b2b07Suwe.El
150*cc0b2b07Suwe.
151ed37916eSpooka.Pp
152ed37916eSpookaIn case
153*cc0b2b07Suwe.Ic hostpath
154a9061c30Spookadoes not exist, it will be created as a regular file with mode
155a9061c30Spooka0644 (plus any restrictions placed by umask).
156ed37916eSpookaIn case
157*cc0b2b07Suwe.Ic hostpath
158ed37916eSpookais a regular file and is not large enough to accommodate the
159ed37916eSpookaspecified size, it will be extended to the specified size.
16078f20aa8Spooka.It Fl l Ar library
16178f20aa8SpookaCall
162*cc0b2b07Suwe.Xr dlopen 3
16378f20aa8Spookaon library before initializing the rump kernel.
16478f20aa8SpookaIn case
16578f20aa8Spooka.Ar library
16678f20aa8Spookaprovides a kernel module, it will appear as a builtin module in the
16778f20aa8Spookarump kernel.
16877666f11SpookaAny rump kernel component present in
16978f20aa8Spooka.Ar library
17078f20aa8Spookawill also be initialized.
17178f20aa8Spooka.Pp
17278f20aa8SpookaThe argument
17378f20aa8Spooka.Ar library
17478f20aa8Spookacan contain a full path or a filename, in which case the standard
17578f20aa8Spookadynamic library search path will be used.
1765304903cSpookaBy default, lazy resolution is used, and may result in a runtime
1775304903cSpookaerror due to missing components.
1785304903cSpookaTo test a configuration, run
1795304903cSpooka.Nm
1805304903cSpookawith
181*cc0b2b07Suwe.Ev LD_BIND_NOW Ns Li \&=1
182*cc0b2b07Suwe.Pq see Sx EXAMPLES .
18378f20aa8Spooka.It Fl m Ar module
18478f20aa8SpookaLoad and link a kernel module after the rump kernel is initialized.
18578f20aa8SpookaFor this to work, the rump kernel must include the vfs faction,
186*cc0b2b07Suwesince the module is loaded using kernel vfs code
187*cc0b2b07Suwe.Pq see Sx EXAMPLES .
18829d11b77Spooka.It Fl r Ar total_ram
18929d11b77SpookaSets the limit of kernel memory allocatable by the server to
19029d11b77Spooka.Ar total_ram
19129d11b77Spookaas opposed to the default which allows the server to allocate as much
19229d11b77Spookamemory as the host will give it.
19329d11b77SpookaThis parameter is especially useful for VFS servers, since by
19429d11b77Spookadefault the virtual file system will attempt to consume as much
19529d11b77Spookamemory as it can, and accessing large files can cause an excessive
19629d11b77Spookaamount of memory to be used as file system cache.
19778f20aa8Spooka.It Fl s
19878f20aa8SpookaDo not detach from the terminal.
19978f20aa8SpookaBy default,
20078f20aa8Spooka.Nm
20178f20aa8Spookadetaches from the terminal once the service is running on
20278f20aa8Spooka.Ar url .
20329d11b77Spooka.It Fl v
204*cc0b2b07SuweSet
205*cc0b2b07Suwe.Dv AB_VERBOSE
206*cc0b2b07Suwein rump kernel's
207*cc0b2b07Suwe.Xr boothowto 9 .
20878f20aa8Spooka.El
20978f20aa8Spooka.Pp
21078f20aa8SpookaAfter use,
21178f20aa8Spooka.Nm
21278f20aa8Spookacan be made to exit using
213d5dca2a9Swiz.Xr rump.halt 1 .
21478f20aa8Spooka.Sh EXAMPLES
21578f20aa8SpookaStart a server and load the tmpfs file system module, and halt the
21678f20aa8Spookaserver immediately afterwards:
21778f20aa8Spooka.Bd -literal -offset indent
21878f20aa8Spooka$ rump_server -lrumpvfs -m /modules/tmpfs.kmod unix://sock
21978f20aa8Spooka$ env RUMP_SERVER=unix://sock rump.halt
22078f20aa8Spooka.Ed
221dbc10b5aSpooka.Pp
222dbc10b5aSpookaStart a server with the one gigabyte host file
223dbc10b5aSpooka.Pa dk.img
224dbc10b5aSpookamapped as the block device
225dbc10b5aSpooka.Pa /dev/dk
226dbc10b5aSpookain the rump kernel.
227*cc0b2b07Suwe.Pp
228*cc0b2b07Suwe.Dl $ rump_allserver -d key=/dev/dk,hostpath=dk.img,size=1g unix://sock
229b6c04e07Spooka.Pp
230b6c04e07SpookaStart a server which listens on INADDR_ANY port 3755
231*cc0b2b07Suwe.Pp
232*cc0b2b07Suwe.Dl $ rump_server tcp://0:3755/
23329d11b77Spooka.Pp
2345304903cSpookaTest that a configuration contains all of the necessary components:
235*cc0b2b07Suwe.Pp
236*cc0b2b07Suwe.Dl $ env LD_BIND_NOW=1 rump_server -lrumpvfs -lrumpfs_ffs unix://tsock
2375304903cSpooka.Pp
23829d11b77SpookaStart a FFS server with a 16MB kernel memory limit.
239*cc0b2b07Suwe.Pp
240*cc0b2b07Suwe.Dl $ rump_server -lrumpfs_ffs [...] -r 16m unix://ffs
24178f20aa8Spooka.Sh SEE ALSO
24278f20aa8Spooka.Xr rump.halt 1 ,
24378f20aa8Spooka.Xr dlopen 3 ,
24456905440Spooka.Xr rump 3 ,
245*cc0b2b07Suwe.Xr rump_etfs 3 ,
24656905440Spooka.Xr rump_sp 7
247