]> sourceware.org Git - systemtap.git/blame - stap-server.8
PR13313 cont'd, fix regexp for [+-]D[+-]D[+-]D(...) operand case
[systemtap.git] / stap-server.8
CommitLineData
ec1a2239 1.\" -*- nroff -*-
f7470174 2.TH STAP\-SERVER 8
ec1a2239 3.SH NAME
aeb9cc10 4stap\-server \- systemtap compile server management
ec1a2239
LB
5
6.SH SYNOPSIS
7
8.br
9[
10.B service
11]
12.B stap\-server
13{
14.B start
15|
16.B stop
17|
18.B restart
19|
20.B condrestart
21|
22.B try\-restart
23|
24.B force\-reload
25|
26.B status
27} [
28.I options
29]
30
31.SH DESCRIPTION
32
17874af3 33A systemtap compile server listens for connections from stap clients
ec1a2239
LB
34on a secure SSL network port and accepts requests to run the
35.I stap
36front end. Each server advertises its presence and configuration on the local
37network using mDNS (\fIavahi\fR) allowing for automatic detection by clients.
38
39.PP
40The stap\-server script aims to provide:
41.IP \(bu 4
42management of systemtap compile servers as a service.
43.IP \(bu 4
44convenient control over configured servers and individual (ad\-hoc) servers.
45
46.SH ARGUMENTS
47One of the actions below must be specified:
48.TP
49.B start
50Start servers. The specified servers are started.
51If no server is specified, the configured servers are started. If no servers
52are configured, a server for the kernel release and architecture of the host
53is started.
54If a specified server is
55already started, this action will
56be ignored for that server. If a server fails to start, this action fails.
57
58.TP
59.B stop
60Stop server(s). The specified servers are stopped.
61If no server is specified, all currently running servers are stopped.
62If a specified server is
63not running, this action
64will be successful for that server. If a server fails to stop, this action
65fails.
66
67.TP
68.B restart
69Stop and restart servers. The specified servers are stopped and restarted.
70If no server is specified, all currently running servers are stopped and
71restarted. If no servers are running, this action behaves like \fIstart\fR.
72
73.TP
74.B condrestart
75Stop and restart servers. The specified servers are stopped and restarted.
76If a specified server is not running, it is not started. If no server is
77specified, all currently running servers are stopped and restarted. If no
78servers are running, none will be started.
79
80.TP
81.B try\-restart
82This action is identical to \fIcondrestart\fR.
83
84.TP
85.B force\-reload
86Stop all running servers, reload config files and restart the service as if
87.I start
88was specified.
89
90.TP
91.B status
92Print information about running servers. Information about the specified
93server(s) will be printed. If no server is specified, information about all
94running servers will be printed.
95
96.SH OPTIONS
97The following options are used to provide additional configuration and
98to specify servers to be managed:
99
100.TP
101\fB\-c\fR \fIconfigfile\fR
102This option specifies a global configuration file in addition to the default
103global configuration file described
104below. This file will be processed after the default global
105configuration file. If the \fB\-c\fR option is specified more than once, the
106last
107configuration file specified will be used.
108
109.TP
110\fB\-a\fR \fIarchitecture\fR
111This option specifies the target architecture of the server and is
112analogous to the \fB\-a\fR option of \fIstap\fR. See the
113.IR stap (1)
114manual page for more details.
115The default architecture is the architecture of the host.
116
117.TP
118\fB\-r\fR \fIkernel\-release\fR
119This option specifies the target kernel release of the server and is
120analogous to the \fB\-r\fR option of \fIstap\fR. See the
121.IR stap (1)
122manual page for more details.
123The default release is that of the currently running kernel.
124
125.TP
126\fB\-I\fR \fIpath\fR
127This option specifies an additional path to be searched by the server(s) for
128tapsets and is analogous to the \fB\-I\fR option of \fIstap\fR.
129See the
130.IR stap (1)
131manual page for more details.
132
133.TP
134\fB\-R\fR \fIpath\fR
135This option specifies the location of the systemtap runtime to be used by the
136server(s) and is analogous to the \fB\-R\fR option of \fIstap\fR.
137See the
138.IR stap (1)
139manual page for more details.
140
141.TP
142\fB\-B\fR \fIoptions\fR
143This option specifies options to be passed to \fImake\fR when building systemtap
144modules and is analogous to the \fB\-B\fR option of \fIstap\fR.
145See the
146.IR stap (1)
147manual page for more details.
148
149.TP
150\fB\-i\fR
151This option is a shortcut which specifies one server for each kernel
152release installed in \fI/lib/modules/\fR. Previous
153\fB\-I\fR, \fB\-R\fR, \fB\-B\fR and \fB\-u\fR options will be
154applied to each server, however previous \fB\-a\fR options will be ignored and
155the default architecture will be used.
156
157.TP
158\fB\-n\fR \fInickname\fR
159This option allows the specification of a server configuration by nickname.
160When \fB\-n\fR is specified, a currently running server with the given nickname
161will be searched for. If no currently running server with the given nickname is
162found, a server configuration with the given nickname will be searched for in
80f2faf4
DB
163the configuration files for default servers,
164or the path configured in the global configuration file or
165the configuration file specified by the
ec1a2239
LB
166\fB\-c\fR option. If a server configuration for the given
167nickname is found, the
168\fB\-a\fR, \fB\-r\fR, \fB\-I\fR, \fB\-R\fR, \fB\-B\fR and \fB\-u\fR options for
169that server will be used as if they were specified on the command line. If no
170configuration with the given nickname is found, and the action is
171.I start
172(or an action behaving like \fIstart\fR
173(see \fBARGUMENTS\fR), the server will be started with the given nickname.
174If no configuration with the given nickname is found, and the action is not
175.I start
176(or an action behaving like \fIstart\fR), it is an error. If a nickname is
177not specified for a server which is being started, its nickname will be its
178process id.
179
180.TP
181\fB\-p\fR \fIpid\fR
182This option allows the specification of a server configuration by process id.
183When \fB\-p\fR is specified, a currently running server with the given process
184id will be searched for. If no such server is found, it is an error. If a server
185with the given procss id is found, the
186\fB\-a\fR, \fB\-r\fR, \fB\-I\fR, \fB\-R\fR, \fB\-B\fR and \fB\-u\fR options for
187that server will be used as if they were specified on the command line.
188
189.TP
190\fB\-u\fR \fIuser\-name\fR
191Each systemtap compile server is normally run by the user name
192\fistap\-server\fR (for the initscript) or as the user invoking
f7470174 193\fIstap\-server\fR,
ec1a2239
LB
194unless otherwise configured (see \fBFILES\fR). This option
195specifies the user name used to run the server(s). The user name specified
196must be a member of the group \fIstap\-server\fR.
197
198.SH CONFIGURATION
199
200Configuration files allow us to:
201.IP \(bu 4
202specify global configuration of logging, server configuration files, status
203files and other global parameters.
204.IP \(bu 4
205specify which servers are to be started by default.
206
207.SH Global Configuration
208
80f2faf4 209The Global Configuration file contains
c807ba1b
DB
210variable assignments used to configure the overall operation of the service.
211Each line beginning with a '#' character is ignored. All other lines must be
212of the form \fIVARIABLE=VALUE\fR. This is not a shell script. The entire
213contents of the line after the = will be assigned as\-is to the variable.
214
215The following variables may be assigned:
ec1a2239
LB
216
217.TP
218.B CONFIG_PATH
219Specifies the absolute path of the directory containing the default server
80f2faf4 220configurations.
ec1a2239
LB
221
222.TP
223.B STAT_PATH
80f2faf4 224Specifies the absolute path of the running server status directory.
ec1a2239
LB
225
226.TP
227.B LOG_FILE
80f2faf4 228Specifies the absolute path of the log file.
ec1a2239
LB
229
230.TP
231.B STAP_USER
232Specifies the userid which will be used to run the server(s)
233(default: for the initscript \fIstap\-server\fR, otherwise the user running
f7470174 234\fIstap\-server\fR).
ec1a2239
LB
235
236.SH Individual Server Configuration
237
238Each server configuration file configures a server to be started when no
239server is specified for the \fIstart\fR action, or an action behaving like the
c807ba1b
DB
240\fIstart\fR action (see \fIARGUMENTS\fR). Each configuration file contains
241variable assignments used to configure an individual server.
242
243Each line beginning with a '#' character is ignored. All other lines must be
244of the form \fIVARIABLE=VALUE\fR. This is not a shell script. The entire
245contents of the line after the = will be assigned as\-is to the variable.
246
247Each configuration file must have a
248filename suffix of \fI.conf\fR. The default
80f2faf4 249location of these files can be
c807ba1b
DB
250overridden in the global configuration file using the \fB\-c\fR option
251(see \fIOPTIONS\fR).
ec1a2239 252
c807ba1b 253The following variables may be assigned:
ec1a2239
LB
254.TP
255.B ARCH
256Specifies the target architecture for this server and corresponds to the
257\fB\-a\fR option (see \fIOPTIONS\fR). If \fBARCH\fR is not set, the
258architecture of the host will be used.
259
260.TP
261.B RELEASE
262Specifies the kernel release for this server
263and corresponds to the
264\fB\-r\fR option (see \fIOPTIONS\fR). If \fBRELEASE\fR is not set, the
265release
266of the kernel running on the host will be used.
267
268.TP
269.B BUILD
270Specifies options to be passed to the \fImake\fR process used by
c807ba1b
DB
271\fIsystemtap\fR to build kernel modules.
272This an array variable with each element corresponding to a
273\fB\-B\fR option (see \fIOPTIONS\fR). Using the form \fBBUILD=STRING\fR clears
274the array and sets the first element to \fBSTRING\fR. Using the form
275\fBBUILD+=STRING\fR adds \fBSTRING\fR as an additional element to the array.
ec1a2239
LB
276
277.TP
278.B INCLUDE
c807ba1b
DB
279Specifies a list of directories to be searched by the server for tapsets.
280This an array variable with each element corresponding to an
281\fB\-I\fR option (see \fIOPTIONS\fR). Using the form \fBINCLUDE=PATH\fR clears
282the array and sets the first element to \fBPATH\fR. Using the form
283\fBINCLUDE+=PATH\fR adds \fBPATH\fR as an additional element to the array.
ec1a2239
LB
284
285.TP
286.B RUNTIME
287Specifies the directory which contains the systemtap runtime code to be used
288by this server
289and corresponds to the
290\fB\-R\fR option (see \fIOPTIONS\fR).
291
292.TP
293.B USER
294Specifies the user name to be used to run this server
295and corresponds to the
296\fB\-u\fR option (see \fIOPTIONS\fR).
297
298.TP
299.B NICKNAME
300Specifies the nickname to be used to refer to this server
301and corresponds to the
302\fB\-n\fR option (see \fIOPTIONS\fR).
303
304.SH SERVER AUTHENTICAION
305The security of the SSL network connection between the client and server
306depends on the proper
307management of server certificates.
308
309.PP
aeb9cc10
DB
310The trustworthiness of a given systemtap compile server can not be determined
311automatically without a trusted certificate authority issuing systemtap compile server
ec1a2239
LB
312certificates. This is
313not practical in everyday use and so, clients must authenticate servers
314against their own database of trusted server certificates. In this context,
315establishing a given server as trusted by a given client means adding
316that server\[aq]s certificate to the
317client\[aq]s database of trusted servers.
318
319.PP
320For the \fIstap\-server\fR initscript, on the local host, this is handled
321automatically.
322When the \fIsystemtap\-server\fR package is installed, the server\[aq]s
323certificate for the default user (\fIstap\-server\fR) is automatically
324generated and installed. This means that servers started by the
325\fIstap\-server\fR initscript,
326with the default user, are automatically trusted by clients on the local
80f2faf4
DB
327host, both as an SSL peer and as a systemtap module signer. Furthermore,
328when stap is invoked by an unprivileged user
329(not root, not a member of the group stapdev, but a member of the group
330stapusr), the options \fI\-\-use\-server\fR and \fI\-\-unprivileged\fR
331are automatically added to the specified options.
332This means that unprivileged users
333on the local host can use a server on the local host
334in unprivileged mode with no further setup or options required.
ec1a2239
LB
335
336.PP
337In order to use a server running on another host, that server\[aq]s certificate
338must be installed on the client\[aq]s host.
17874af3
DB
339See the \fI\-\-trust\-servers\fR option in the
340.IR stap (1)
80f2faf4
DB
341manual page for more details and README.unprivileged in the systemtap sources
342for more details..
ec1a2239
LB
343
344.SH EXAMPLES
345See the
346.IR stapex (3stap)
347manual page for a collection of sample \fIsystemtap\fR scripts.
348.PP
349To start the configured servers, or the default server, if none are configured:
350.PP
351.B \& $ [ service ] stap\-server start
352.PP
353To start a server for each kernel installed in /lib/modules:
354.PP
355.B \& $ [ service ] stap\-server start \-i
356.PP
357To obtain information about the running server(s):
358.PP
359.B \& $ [ service ] stap\-server status
360.PP
361To start a server like another one, except targeting a different architecture,
362by referencing the first server\[aq]s nickname:
363.PP
364.B \& $ [ service ] stap\-server start \-n \fINICKNAME\fR \-a \fIARCH\fR
365.PP
366To stop one of the servers by referencing its process id (obtained by running
367\fBstap\-server status\fR):
368.PP
369.B \& $ [ service ] stap\-server stop \-p \fIPID\fR
370.PP
80f2faf4
DB
371To run a script using a compile server:
372.PP
373.B \& $ stap SCRIPT \-\-use\-server
374.PP
375To run a script as an unprivileged user using a compile server:
376.PP
377.B \& $ stap SCRIPT
378.PP
ec1a2239
LB
379To stop all running servers:
380.PP
381.B \& $ [ service ] stap\-server stop
382
383.SH SAFETY AND SECURITY
384Systemtap is an administrative tool. It exposes kernel internal data
385structures and potentially private user information. See the
386.IR stap (1)
387manual page for additional information on safety and security.
388
389.PP
f7470174 390As a network server, stap\-server should be activated with care in
ec1a2239
LB
391order to limit the potential effects of bugs or mischevious users.
392Consider the following prophylactic measures.
393.TP
3941
b6f2661b
DB
395Run stap\-server as an unprivileged user, never as root.
396
397When invoked as a
398service (i.e. \fBservice stap\-server\fR ...), each server is run,
399by default, as the user \fIstap\-server\fR.
400When invoked directly (i.e. \fBstap\-server\fR ...), each server is run,
401by default, as the invoking user. In each case, another user may be selected by
402using the \fI\-u\fR option on invocation, by specifying
403\fISTAP_USER=\fRusername in the global configuration file or by specifying
404\fIUSER=\fRusername in an individual server configuration file. The invoking
405user must have authority to run processes as another user.
406See \fICONFIGURATION\fR.
407
80f2faf4
DB
408The selected user must have write access to the server log file.
409The location of the server log file may
b6f2661b
DB
410be changed by setting \fILOG_FILE=\fRpath in the global configuration file.
411See \fICONFIGURATION\fR.
412
413The selected user must have
80f2faf4
DB
414read/write access to the directory containing the server status files.
415The location of the server
b6f2661b
DB
416status files may be changed by setting \fISTAT_PATH=\fRpath in the global
417configuration file.
418See \fICONFIGURATION\fR.
419
420The selected user must have
80f2faf4 421read/write access to the uprobes.ko build directory and its files.
b6f2661b
DB
422
423Neither form of stap\-server will run if the selected user is root.
424
ec1a2239
LB
425.TP
4262
f7470174 427Run stap\-server with resource limits that impose maximum
ec1a2239
LB
428cpu time, file size, memory consumption, in order to bound
429the effects of processing excessively large or bogus inputs.
b6f2661b
DB
430
431When the user running the servers is \fIstap\-server\fR,
432each server is run with limits equivalent to
433
f7470174 434 ulimit \-f 50000 \-s 1000 \-t 60 \-u 20 \-v 500000
b6f2661b
DB
435
436otherwise, no limits are imposed.
437
ec1a2239
LB
438.TP
4393
f7470174 440Run stap\-server with a TMPDIR environment variable that
ec1a2239
LB
441points to a separate and/or quota-enforced directory, in
442order to prevent filling up of important filesystems.
b6f2661b
DB
443
444The default TMPDIR is \fI/tmp/\fR.
445
ec1a2239
LB
446.TP
4474
17874af3 448Activate network firewalls to limit stap client connections
ec1a2239
LB
449to relatively trustworthy networks.
450
b6f2661b
DB
451For automatic selection of servers by clients, \fIavahi\fR must be installed
452on both the server and client hosts and \fImDNS\fR messages must be allowed through the firewall.
453
ec1a2239 454.PP
aeb9cc10 455The systemtap compile server and its related utilities use the Secure Socket Layer
ec1a2239 456(SSL) as implemented by Network Security Services (NSS)
aeb9cc10
DB
457for network security. NSS is also used
458for the generation and management of certificates. The related
ec1a2239
LB
459certificate databases must be protected in order to maintain the security of
460the system.
461Use of the utilities provided will help to ensure that the proper protection
462is maintained. The systemtap client will check for proper
463access permissions before making use of any certificate database.
464
465.SH FILES
466.TP
80f2faf4
DB
467Important files and their corresponding paths can be located in the
468stappaths (7) manual page.
ec1a2239
LB
469
470.SH SEE ALSO
471.IR stap (1),
472.IR staprun (8),
ec1a2239
LB
473.IR stapprobes (3stap),
474.IR stapfuncs (3stap),
c807ba1b 475.IR stappaths (7),
ec1a2239 476.IR stapex (3stap),
b6f2661b 477.IR avahi ,
ec1a2239 478.IR ulimit (1),
aeb9cc10 479.IR NSS
ec1a2239
LB
480
481.SH BUGS
482Use the Bugzilla link of the project web page or our mailing list.
483.nh
306dd4f8 484.BR http://sourceware.org/systemtap/ ", " <systemtap@sourceware.org> .
ec1a2239
LB
485.hy
486
This page took 0.096975 seconds and 5 git commands to generate.