summaryrefslogtreecommitdiffstats
path: root/initscript/README.stap-server
blob: 1e1d1bf507582797012f97e94f0b0ebc998d44d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
stap-server initscript
Version 0.1.0

INDEX
=====
1. Introduction
2. Usage
3. Files
4. Configuration Format
5. Usage Examples

1. Introduction
===============
The stap-server init script aims to provide
- management of systemtap compile servers as a service.
- convenient control over configured servers and individual (ad-hoc) servers.

2. Usage
========
2.1 Synopsis
------------
  /sbin/service stap-server {start|stop|restart|condrestart|try-restart|force-reload|status} [options]

2.2 Actions
-----------
One of the actions below must be specified.

2.2.1 start
 Start server(s). If a specified server is already started, this action will
 be ignored for that server. If any server fails to start this action fails.
 If no server is specified, the configured servers are started. If no servers
 are configured, a server for the kernel release and architecture of the host
 is started.

2.2.2 stop
 Stop server(s). If a specified server is already stopped, this action
 will be ignored for that server. If a server fails to stop, this action fails.
 If no server is specified, all currently running servers are stopped.

2.2.3 restart
 Stop and start servers again. The specified servers are stopped and restarted.
 If no server is specified, all currently running servers are stopped and
 restarted. If no servers are running this action behaves like 'start'.

2.2.4 condrestart
 Stop and start servers again. The specified servers are stopped and restarted.
 If a specified server is not running, it is not started. If no server is
 specified, all currently running servers are stopped and restarted.  If no
 servers are running, none will be started.

2.2.5 try-restart
 This action is identical to condrestart.

2.2.6 force-reload
 Stop all running servers, reload config files and restart the service as if
 'start' was specified.

2.2.7 status
 Print information about running servers. Information about the specified
 server(s) will be printed. If no server is specified, information about all
 running servers will be printed.

2.3 Options
-----------
The following options may be used to provide additional configuration and
to specify servers to be managed.

2.3.1 -c configfile
 This option specifies a configuration file in addition to those described
 in section 4 below. This file will be processed after the default
 configuration file. If the -c option is specified more than once, the last
 configuration file specified will be used.

2.3.2 -a architecture
 Each stap-server instance targets a specific kernel release and target
 architecture.  This option specifies the target architecture to be associated
 with subsequent -r options. The default architecture is the architecture of
 the host.

2.3.3 -r kernel-release
 This option specifies a server for the given kernel release and the current
 target architecture (specified by a previous -a option, or the default). The
 arguments accepted by this option are the same as for stap itself. See stap(1)
 for more details.

2.3.4 -i
 This option is a shortcut which specifies one server for each kernel
 release installed in /lib/modules/. The default architecture is associated
 with these servers (i.e. previous -a has no effect).

3. Files
========
3.1 stap-server
---------------
/etc/init.d/stap-server

This is the stap-server initscript.

3.2 Configuration files
-----------------------
Configuration files are written in bash script.

3.2.1 Global config file
 /etc/sysconfig/stap-server

 This config file is for global configuration (see section 4.1).

3.2.2 Server config files
 /etc/stap-server/conf.d/*.conf

 The config files under this directory are for each server to be started by
 default (see section see 4.2).

3.3 Message Log
---------------
/var/log/stap-server.log

All messages including server errors and detailed messages are sent
to this file.
Some error and warning messages are also sent to console and syslogd (syslog
output is optional, because this service may start before syslog).

3.4 Status files
----------------
/var/run/stap-server/<server_spec>

4. Configuration Format
=======================
Configuration files allows us to
  - specify global configuration of logging, server configuration files, status
    files and other global parameters.
  - specify which servers are to be started by default.

4.1 Global Configuration file (/etc/sysconfig/stap-server)
----------------------------------------------------------
The global configuration file may contain settings for the following
variables.

4.1.1 CONFIG_PATH
 Specify the absolute path of the directory containing the default server
 configurations.
 (default: /etc/stap-server/conf.d)

4.1.2 STAT_PATH
 Specify the absolute path of the running server status directory.
 (default: /var/run/stap-server)

4.1.3 LOG_FILE
 Specify the absolute path of the log file
 (default: /var/log/stap-server.log)

4.1.4 STAP_USER
 Specify the userid which will be used to run the server(s).
 (default: stap-server)

4.2 Individual server configuration (/etc/stap-server/conf.d/*.conf)
--------------------------------------------------------------------
Each server configuration file configures a server to be started when no
server is specified for the 'start' action.

4.2.1 ARCH
 Specify the target architecture for this server. If ARCH is not set, the
 architecture of the host will be used.

4.2.2 RELEASE
 Specify the kernel release for this server. If RELEASE is not set, the release
 of the kernel running on the host will be used.
 
4.3 Configuration Example
-------------------------

4.3.1 Global Config Example (/etc/sysconfig/stap-server)
 ---
 CONFIG_PATH=~<user>/my-stap-server-configs
 LOG_FILE=/tmp/stap-server.log
 ---

4.3.2 Server Config Examples (/etc/stap-server/conf.d/*.conf)
 --- file1.conf
 ARCH=i386
 RELEASE=2.6.18-128.el5
 --- file2.conf
 ARCH=powerpc
 RELEASE=/kernels/2.6.18-92.1.18.el5/build
 ---

5. Usage Eamples
================

5.1 Package Installation
------------------------
After installing the systemtap package, install the systemtap-server package.
# yum install systemtap-server
This package will include the initscript, default configuration files and
other files.

5.2 Testing
-----------
See if the default service operates correctly.
 # service stap-server start
 # service stap-server status
 # service stap-server restart
 # service stap-server status
 # service stap-server condrestart
 # service stap-server status
 # service stap-server force-reload
 # service stap-server status
 # service stap-server stop
 # service stap-server status
 # service stap-server condrestart
 # service stap-server status       # <---no server should be running

If there are no errors, the service is correctly installed.

5.3 Service Enabling
--------------------
After all test have passed, enable the stap-server initscript.
# chkconfig stap-server on

5.4 Starting Specific Servers
-----------------------------
5.4.1 Starting a server for an installed kernel release

  # service stap-server start -r <release>
   
  where <release> refers to a kernel installed in /lib/modules

5.4.2 Starting servers for all installed kernel releases

  # service stap-server start -i

5.4.3 Starting a server for a kernel release not installed (cross compiling)

  # service stap-server start -a <arch> -r /<builddir>
   
  where <arch> is the target architecture and
        <buildder> is the absolute path to the kernel's build tree.

5.5 Managing Specific Servers
-----------------------------
Specifying an architecture and/or release for all other actions will act on
that server alone (if it is running). For example

  # service stap-server status -r 2.6.18-128.el5
  # service stap-server restart -a i386 -r 2.6.18-92.1.18.el5
  # service stap-server stop -a powerpc -r /kernels/2.6.18-92.1.18.el5/build

5.6 Configuring Default Servers
-------------------------------
5.6.1 Create Server Config Files
 Each file in /etc/stap-server/conf.d/*.conf represents a server to be started
 by default if no servers are specified on the 'start' action. Each such
 config file may set the ARCH and/or RELEASE variables which correspond to the
 -a and -r command line options respectively.

 # vi /etc/stap-server/conf.d/2.6.18-128.el5.conf
 ARCH=     # default arch
 RELEASE=2.6.18-128.el5

 # vi /etc/stap-server/conf.d/powerpc.conf
 ARCH=powerpc
 RELEASE=  #default release

 # vi /etc/stap-server/conf.d/native.conf
 ARCH=     #default arch
 RELEASE=  #default release

5.6.2 Starting Default Servers

 # service stap-server start

5.6.2 Restarting After Changing the Configuration

 To restart the service after global configuration changes and/or when default
 servers have been added to removed:

 # service stap-server force-reload

5.7 Stopping the stap-server Service
------------------------------------

 To stop all running servers:

 # service stap-server stop