2
|
1 |
.'" t
|
|
2 |
."
|
|
3 |
." Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
|
|
4 |
." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
5 |
."
|
|
6 |
." This code is free software; you can redistribute it and/or modify it
|
|
7 |
." under the terms of the GNU General Public License version 2 only, as
|
|
8 |
." published by the Free Software Foundation.
|
|
9 |
."
|
|
10 |
." This code is distributed in the hope that it will be useful, but WITHOUT
|
|
11 |
." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
12 |
." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
13 |
." version 2 for more details (a copy is included in the LICENSE file that
|
|
14 |
." accompanied this code).
|
|
15 |
."
|
|
16 |
." You should have received a copy of the GNU General Public License version
|
|
17 |
." 2 along with this work; if not, write to the Free Software Foundation,
|
|
18 |
." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
19 |
."
|
|
20 |
." Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
|
21 |
." CA 95054 USA or visit www.sun.com if you need additional information or
|
|
22 |
." have any questions.
|
|
23 |
."
|
|
24 |
." `
|
|
25 |
.TH rmid 1 "05 Aug 2006"
|
|
26 |
." Generated by html2roff
|
|
27 |
.\\" Changed by: Ann Wollrath \- JavaSoft East, 2\-Mar\-2000
|
|
28 |
.\\" Changed by: Jen McGinn \- Jini Technology Software, 6\-Mar\-2000
|
|
29 |
.LP
|
|
30 |
.SH NAME
|
|
31 |
rmid \- The Java RMI Activation System Daemon
|
|
32 |
.LP
|
|
33 |
|
|
34 |
.LP
|
|
35 |
.LP
|
|
36 |
\f3rmid\fP starts the activation system daemon that allows objects to be registered and activated in a virtual machine (VM).
|
|
37 |
.LP
|
|
38 |
.SH "SYNOPSIS"
|
|
39 |
.LP
|
|
40 |
|
|
41 |
.LP
|
|
42 |
.nf
|
|
43 |
\f3
|
|
44 |
.fl
|
|
45 |
rmid [options]
|
|
46 |
.fl
|
|
47 |
\fP
|
|
48 |
.fi
|
|
49 |
|
|
50 |
.LP
|
|
51 |
.SH "DESCRIPTION"
|
|
52 |
.LP
|
|
53 |
|
|
54 |
.LP
|
|
55 |
.LP
|
|
56 |
The \f3rmid\fP tool starts the activation system daemon. The activation system daemon must be started before activatable objects can be either registered with the activation system or activated in a VM. See the
|
|
57 |
.na
|
|
58 |
\f2Java RMI Specification\fP @
|
|
59 |
.fi
|
|
60 |
http://java.sun.com/javase/6/docs/platform/rmi/spec/rmitoc.html and
|
|
61 |
.na
|
|
62 |
\f2Activation tutorials\fP @
|
|
63 |
.fi
|
|
64 |
http://java.sun.com/javase/6/docs/technotes/guides/rmi/activation/overview.html for details on how to write programs that use activatable remote objects.
|
|
65 |
.LP
|
|
66 |
.LP
|
|
67 |
The daemon can be started by executing the \f2rmid\fP command, and specifying a security policy file, as follows:
|
|
68 |
.LP
|
|
69 |
.nf
|
|
70 |
\f3
|
|
71 |
.fl
|
|
72 |
rmid \-J\-Djava.security.policy=rmid.policy
|
|
73 |
.fl
|
|
74 |
\fP
|
|
75 |
.fi
|
|
76 |
|
|
77 |
.LP
|
|
78 |
.LP
|
|
79 |
\f3Note:\fP When running Sun's implementation of \f2rmid\fP, by default you will need to specify a security policy file so that \f2rmid\fP can verify whether or not the information in each \f2ActivationGroupDesc\fP is allowed to be used to launch a VM for an activation group. Specifically, the command and options specified by the \f2CommandEnvironment\fP and any \f2Properties\fP passed to an \f2ActivationGroupDesc\fP's constructor must now be explicitly allowed in the security policy file for \f2rmid\fP. The value of the \f2sun.rmi.activation.execPolicy\fP property dictates the policy that \f2rmid\fP uses to determine whether or not the information in an \f2ActivationGroupDesc\fP may be used to launch a VM for an activation group.
|
|
80 |
.LP
|
|
81 |
.LP
|
|
82 |
Executing \f2rmid\fP by default
|
|
83 |
.LP
|
|
84 |
.RS 3
|
|
85 |
.TP 2
|
|
86 |
*
|
|
87 |
starts the Activator and an internal registry on the default port, 1098, and
|
|
88 |
.TP 2
|
|
89 |
*
|
|
90 |
binds an \f2ActivationSystem\fP to the name \f2java.rmi.activation.ActivationSystem\fP in this internal registry.
|
|
91 |
.RE
|
|
92 |
|
|
93 |
.LP
|
|
94 |
.LP
|
|
95 |
To specify an alternate port for the registry, you must specify the \f2\-port\fP option when starting up \f2rmid\fP. For example,
|
|
96 |
.LP
|
|
97 |
.nf
|
|
98 |
\f3
|
|
99 |
.fl
|
|
100 |
rmid \-J\-Djava.security.policy=rmid.policy \-port 1099
|
|
101 |
.fl
|
|
102 |
\fP
|
|
103 |
.fi
|
|
104 |
|
|
105 |
.LP
|
|
106 |
.LP
|
|
107 |
starts the activation system daemon and a registry on the registry's default port, 1099.
|
|
108 |
.LP
|
|
109 |
.SS
|
|
110 |
Starting rmid from
|
|
111 |
inetd/xinetd
|
|
112 |
.LP
|
|
113 |
.LP
|
|
114 |
An alternative to starting \f2rmid\fP from the command line is to configure \f2inetd\fP (Solaris) or \f2xinetd\fP (Linux) to start \f2rmid\fP on demand.
|
|
115 |
.LP
|
|
116 |
.LP
|
|
117 |
When \f2rmid\fP starts up, it attempts to obtain an inherited channel (inherited from \f2inetd\fP/\f2xinetd\fP) by invoking the \f2System.inheritedChannel\fP method. If the inherited channel is \f2null\fP or not an instance of \f2java.nio.channels.ServerSocketChannel\fP, then \f2rmid\fP assumes that it was not started by \f2inetd\fP/\f2xinetd\fP, and it starts up as described above.
|
|
118 |
.LP
|
|
119 |
.LP
|
|
120 |
If the inherited channel is a \f2ServerSocketChannel\fP instance, then \f2rmid\fP uses the \f2java.net.ServerSocket\fP obtained from the \f2ServerSocketChannel\fP as the server socket that accepts requests for the remote objects it exports, namely the registry in which the \f2java.rmi.activation.ActivationSystem\fP is bound and the \f2java.rmi.activation.Activator\fP remote object. In this mode, \f2rmid\fP behaves the same as when it is started from the command line, \f2except\fP:
|
|
121 |
.LP
|
|
122 |
.RS 3
|
|
123 |
.TP 2
|
|
124 |
*
|
|
125 |
Output printed to \f2System.err\fP is redirected to a file. This file is located in the directory specified by the \f2java.io.tmpdir\fP system property (typically \f2/var/tmp\fP or \f2/tmp\fP) with the prefix \f2"rmid\-err"\fP and the suffix \f2"tmp"\fP.
|
|
126 |
.TP 2
|
|
127 |
*
|
|
128 |
The \f2\-port\fP option is disallowed. If this option is specified, \f2rmid\fP will exit with an error message.
|
|
129 |
.TP 2
|
|
130 |
*
|
|
131 |
The \f2\-log\fP option is required. If this option is not specified, \f2rmid\fP will exit with an error message.
|
|
132 |
.RE
|
|
133 |
|
|
134 |
.LP
|
|
135 |
.LP
|
|
136 |
See the man pages for \f2inetd\fP (Solaris) or \f2xinetd\fP (Linux) for details on how to configure services to be started on demand.
|
|
137 |
.LP
|
|
138 |
.SH "OPTIONS"
|
|
139 |
.LP
|
|
140 |
|
|
141 |
.LP
|
|
142 |
.TP 3
|
|
143 |
\-C<someCommandLineOption>
|
|
144 |
Specifies an option that is passed as a command\-line argument to each child process (activation group) of \f2rmid\fP when that process is created. For example, you could pass a property to each virtual machine spawned by the activation system daemon:
|
|
145 |
.nf
|
|
146 |
\f3
|
|
147 |
.fl
|
|
148 |
rmid \-C\-Dsome.property=value
|
|
149 |
.fl
|
|
150 |
\fP
|
|
151 |
.fi
|
|
152 |
This ability to pass command\-line arguments to child processes can be useful for debugging. For example, the following command:
|
|
153 |
.nf
|
|
154 |
\f3
|
|
155 |
.fl
|
|
156 |
rmid \-C\-Djava.rmi.server.logCalls=true
|
|
157 |
.fl
|
|
158 |
\fP
|
|
159 |
.fi
|
|
160 |
will enable server\-call logging in all child VMs.
|
|
161 |
.LP
|
|
162 |
.TP 3
|
|
163 |
\-J<someCommandLineOption>
|
|
164 |
Specifies an option that is passed to the \f2java\fP interpreter running \f2rmid\fP. For example, to specify that \f2rmid\fP use a policy file named \f2rmid.policy\fP, the \f2\-J\fP option can be used to define the \f2java.security.policy\fP property on \f2rmid\fP's command line, for example:
|
|
165 |
.nf
|
|
166 |
\f3
|
|
167 |
.fl
|
|
168 |
rmid \-J\-Djava.security.policy=rmid.policy
|
|
169 |
.fl
|
|
170 |
\fP
|
|
171 |
.fi
|
|
172 |
.TP 3
|
|
173 |
|
|
174 |
\-J\-Dsun.rmi.activation.execPolicy=<policy>
|
|
175 |
Specifies the policy that \f2rmid\fP employs to check commands and command\-line options used to launch the VM in which an activation group runs. Please note that this option exists only in Sun's implementation of the Java RMI activation daemon. If this property is not specified on the command line, the result is the same as if \f2\-J\-Dsun.rmi.activation.execPolicy=default\fP were specified. The possible values of \f2<policy>\fP can be \f2default\fP, \f2<policyClassName>\fP, or \f2none\fP:
|
|
176 |
.LP
|
|
177 |
.RS 3
|
|
178 |
.TP 2
|
|
179 |
*
|
|
180 |
\f3default (or if this property is \fP\f4unspecified\fP\f3)\fP
|
|
181 |
.LP
|
|
182 |
The default \f2execPolicy\fP allows \f2rmid\fP to execute commands with specific command\-line options only if \f2rmid\fP has been granted permission to execute those commands and options in the security policy file that \f2rmid\fP uses. Only the default activation group implementation can be used with the \f2default\fP execution policy.
|
|
183 |
.LP
|
|
184 |
\f2rmid\fP launches a VM for an activation group using the information in the group's registered activation group descriptor, an \f2ActivationGroupDesc\fP. The group descriptor specifies an optional \f2ActivationGroupDesc.CommandEnvironment\fP which includes the \f2command\fP to execute to start the activation group as well as any command line \f2options\fP to be added to the command line. By default, \f2rmid\fP uses the \f2java\fP command found in \f2java.home\fP. The group descriptor also contains \f2properties\fP overrides that are added to the command line as options defined as:
|
|
185 |
.nf
|
|
186 |
\f3
|
|
187 |
.fl
|
|
188 |
\-D\fP\f4<property>\fP\f3=\fP\f4<value>\fP\f3
|
|
189 |
.fl
|
|
190 |
\fP
|
|
191 |
.fi
|
|
192 |
.LP
|
|
193 |
The permission \f2com.sun.rmi.rmid.ExecPermission\fP is used to grant \f2rmid\fP permission to execute a command, specified in the group descriptor's \f2CommandEnvironment\fP to launch an activation group. The permission \f2com.sun.rmi.rmid.ExecOptionPermission\fP is used to allow \f2rmid\fP to use command\-line options, specified as properties overrides in the group descriptor or as options in the \f2CommandEnvironment\fP, when launching the activation group.
|
|
194 |
.LP
|
|
195 |
When granting \f2rmid\fP permission to execute various commands and options, the permissions \f2ExecPermission\fP and \f2ExecOptionPermission\fP need to be granted universally (i.e., granted to all code sources).
|
|
196 |
.TP 3
|
|
197 |
ExecPermission
|
|
198 |
The \f2ExecPermission\fP class represents permission for \f2rmid\fP to execute a specific \f2command\fP to launch an activation group.
|
|
199 |
.LP
|
|
200 |
\f3Syntax\fP
|
|
201 |
.br
|
|
202 |
The \f2name\fP of an \f2ExecPermission\fP is the path name of a command to grant \f2rmid\fP permission to execute. A path name that ends in "/*" indicates all the files contained in that directory (where "/" is the file\-separator character, \f2File.separatorChar\fP). A path name that ends with "/\-" indicates all files and subdirectories contained in that directory (recursively). A path name consisting of the special token "<<ALL FILES>>" matches \f3any\fP file.
|
|
203 |
.LP
|
|
204 |
\f3Note:\fP A path name consisting of a single "*" indicates all the files in the current directory, while a path name consisting of a single "\-" indicates all the files in the current directory and (recursively) all files and subdirectories contained in the current directory.
|
|
205 |
.TP 3
|
|
206 |
ExecOptionPermission
|
|
207 |
The \f2ExecOptionPermission\fP class represents permission for \f2rmid\fP to use a specific command\-line \f2option\fP when launching an activation group. The \f2name\fP of an \f2ExecOptionPermission\fP is the value of a command line option.
|
|
208 |
.LP
|
|
209 |
\f3Syntax\fP
|
|
210 |
.br
|
|
211 |
Options support a limited wildcard scheme. An asterisk signifies a wildcard match, and it may appear as the option name itself (i.e., it matches any option), or an asterisk may appear at the end of the option name only if the asterisk follows either a "." or "=".
|
|
212 |
.LP
|
|
213 |
For example: "*" or "\-Dfoo.*" or "\-Da.b.c=*" is valid, "*foo" or "\-Da*b" or "ab*" is not.
|
|
214 |
.TP 3
|
|
215 |
Policy file for
|
|
216 |
rmid
|
|
217 |
When granting \f2rmid\fP permission to execute various commands and options, the permissions \f2ExecPermission\fP and \f2ExecOptionPermission\fP need to be granted universally (i.e., granted to all code sources). It is safe to grant these permissions universally because only \f2rmid\fP checks these permissions.
|
|
218 |
.LP
|
|
219 |
An example policy file that grants various execute permissions to \f2rmid\fP is:
|
|
220 |
.nf
|
|
221 |
\f3
|
|
222 |
.fl
|
|
223 |
grant {
|
|
224 |
.fl
|
|
225 |
permission com.sun.rmi.rmid.ExecPermission
|
|
226 |
.fl
|
|
227 |
"/files/apps/java/jdk1.2.2/solaris/bin/java";
|
|
228 |
.fl
|
|
229 |
|
|
230 |
.fl
|
|
231 |
permission com.sun.rmi.rmid.ExecPermission
|
|
232 |
.fl
|
|
233 |
"/files/apps/java/jdk1.2.2/solaris/bin/java_g";
|
|
234 |
.fl
|
|
235 |
|
|
236 |
.fl
|
|
237 |
permission com.sun.rmi.rmid.ExecPermission
|
|
238 |
.fl
|
|
239 |
"/files/apps/rmidcmds/*";
|
|
240 |
.fl
|
|
241 |
|
|
242 |
.fl
|
|
243 |
permission com.sun.rmi.rmid.ExecOptionPermission
|
|
244 |
.fl
|
|
245 |
"\-Djava.security.policy=/files/policies/group.policy";
|
|
246 |
.fl
|
|
247 |
|
|
248 |
.fl
|
|
249 |
permission com.sun.rmi.rmid.ExecOptionPermission
|
|
250 |
.fl
|
|
251 |
"\-Djava.security.debug=*";
|
|
252 |
.fl
|
|
253 |
|
|
254 |
.fl
|
|
255 |
permission com.sun.rmi.rmid.ExecOptionPermission
|
|
256 |
.fl
|
|
257 |
"\-Dsun.rmi.*";
|
|
258 |
.fl
|
|
259 |
};
|
|
260 |
.fl
|
|
261 |
\fP
|
|
262 |
.fi
|
|
263 |
The first two permissions granted allow \f2rmid\fP to execute the 1.2.2 version of the \f2java\fP and \f2java_g\fP commands, specified by their explicit path names. Note that by default, the version of the \f2java\fP command found in \f2java.home\fP is used (the same one that \f2rmid\fP uses), and does not need to be specified in the policy file. The third permission allows \f2rmid\fP to execute any command in the directory \f2/files/apps/rmidcmds\fP.
|
|
264 |
.LP
|
|
265 |
The fourth permission granted, an \f2ExecOptionPermission\fP, allows \f2rmid\fP to launch an activation group that defines the security policy file to be \f2/files/policies/group.policy\fP. The next permission allows the \f2java.security.debug\fP property to be used by an activation group. The last permission allows any property in the \f2sun.rmi\fP property name hierarchy to be used by activation groups.
|
|
266 |
.LP
|
|
267 |
To start \f2rmid\fP with a policy file, the \f2java.security.policy\fP property needs to be specified on \f2rmid\fP's command line, for example:
|
|
268 |
.RS 3
|
|
269 |
|
|
270 |
.LP
|
|
271 |
.LP
|
|
272 |
\f2rmid \-J\-Djava.security.policy=rmid.policy\fP
|
|
273 |
.LP
|
|
274 |
.RE
|
|
275 |
.TP 2
|
|
276 |
*
|
|
277 |
.TP 2
|
|
278 |
*
|
|
279 |
\f4<policyClassName>\fP
|
|
280 |
.LP
|
|
281 |
If the default behavior is not flexible enough, an administrator can provide, when starting \f2rmid\fP, the name of a class whose \f2checkExecCommand\fP method is executed in order to check commands to be executed by rmid.
|
|
282 |
.LP
|
|
283 |
The \f2policyClassName\fP specifies a public class with a public, no\-argument constructor and an implementation of the following \f2checkExecCommand\fP method:
|
|
284 |
.nf
|
|
285 |
\f3
|
|
286 |
.fl
|
|
287 |
public void checkExecCommand(ActivationGroupDesc desc,
|
|
288 |
.fl
|
|
289 |
String[] command)
|
|
290 |
.fl
|
|
291 |
throws SecurityException;
|
|
292 |
.fl
|
|
293 |
\fP
|
|
294 |
.fi
|
|
295 |
Before launching an activation group, \f2rmid\fP calls the policy's \f2checkExecCommand\fP method, passing it the activation group descriptor and an array containing the complete command to launch the activation group. If the \f2checkExecCommand\fP throws a \f2SecurityException\fP, \f2rmid\fP will not launch the activation group and an \f2ActivationException\fP will be thrown to the caller attempting to activate the object.
|
|
296 |
.LP
|
|
297 |
.TP 2
|
|
298 |
*
|
|
299 |
\f3none\fP
|
|
300 |
.LP
|
|
301 |
If the \f2sun.rmi.activation.execPolicy\fP property value is "none", then \f2rmid\fP will not perform any validation of commands to launch activation groups.
|
|
302 |
.RE
|
|
303 |
.TP 3
|
|
304 |
\-log dir
|
|
305 |
Specifies the name of the directory the activation system daemon uses to write its database and associated information. The log directory defaults to creating a directory, \f2log\fP, in the directory in which the \f2rmid\fP command was executed.
|
|
306 |
.TP 3
|
|
307 |
\-port port
|
|
308 |
Specifies the port \f2rmid\fP's registry uses. The activation system daemon binds the \f2ActivationSystem\fP, with the name \f2java.rmi.activation.ActivationSystem\fP, in this registry. Thus, the \f2ActivationSystem\fP on the local machine can be obtained using the following \f2Naming.lookup\fP method call:
|
|
309 |
.nf
|
|
310 |
\f3
|
|
311 |
.fl
|
|
312 |
import java.rmi.*;
|
|
313 |
.fl
|
|
314 |
import java.rmi.activation.*;
|
|
315 |
.fl
|
|
316 |
|
|
317 |
.fl
|
|
318 |
ActivationSystem system; system = (ActivationSystem)
|
|
319 |
.fl
|
|
320 |
Naming.lookup("//:\fP\f4port\fP/java.rmi.activation.ActivationSystem");
|
|
321 |
.fl
|
|
322 |
.fi
|
|
323 |
.TP 3
|
|
324 |
\-stop
|
|
325 |
Stops the current invocation of \f2rmid\fP, for a port specified by the \f2\-port\fP option. If no port is specified, it will stop the \f2rmid\fP running on port 1098.
|
|
326 |
.SH "ENVIRONMENT VARIABLES"
|
|
327 |
.LP
|
|
328 |
|
|
329 |
.LP
|
|
330 |
.TP 3
|
|
331 |
CLASSPATH
|
|
332 |
Used to provide the system a path to user\-defined classes. Directories are separated by colons. For example:
|
|
333 |
.nf
|
|
334 |
\f3
|
|
335 |
.fl
|
|
336 |
.:/usr/local/java/classes
|
|
337 |
.fl
|
|
338 |
\fP
|
|
339 |
.fi
|
|
340 |
|
|
341 |
.LP
|
|
342 |
.SH "SEE ALSO"
|
|
343 |
.LP
|
|
344 |
|
|
345 |
.LP
|
|
346 |
.LP
|
|
347 |
rmic, CLASSPATH, java
|
|
348 |
.LP
|
|
349 |
|
|
350 |
.LP
|
|
351 |
|