OSDN Git Service

Add linux.x86 linux.x86_64 target
[pizza-ipa-oss/jre.git] / features / jp.pizzafactory.com.sun.jre / rootfiles.linux.x86 / jre / man / man1 / rmid.1
1 ." Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 
2 ."
3 .TH rmid 1 "06 Apr 2010"
4 ." Generated from HTML by html2man (author: Eric Armstrong)
5
6 .LP
7 .SH "Name"
8 rmid \- The Java RMI Activation System Daemon
9 .LP
10 .RS 3
11
12 .LP
13 .LP
14 \f3rmid\fP starts the activation system daemon that allows objects to be registered and activated in a virtual machine (VM).
15 .LP
16 .RE
17 .SH "SYNOPSIS"
18 .LP
19
20 .LP
21 .nf
22 \f3
23 .fl
24 rmid [options]
25 .fl
26 \fP
27 .fi
28
29 .LP
30 .SH "DESCRIPTION"
31 .LP
32
33 .LP
34 .LP
35 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 
36 .na
37 \f2Java RMI Specification\fP @
38 .fi
39 http://java.sun.com/javase/6/docs/platform/rmi/spec/rmiTOC.html and 
40 .na
41 \f2Activation tutorials\fP @
42 .fi
43 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.
44 .LP
45 .LP
46 The daemon can be started by executing the \f2rmid\fP command, and specifying a security policy file, as follows:
47 .LP
48 .nf
49 \f3
50 .fl
51     rmid \-J\-Djava.security.policy=rmid.policy
52 .fl
53 \fP
54 .fi
55
56 .LP
57 .LP
58 \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.
59 .LP
60 .LP
61 Executing \f2rmid\fP by default
62 .LP
63 .RS 3
64 .TP 2
65 o
66 starts the Activator and an internal registry on the default port, 1098, and 
67 .TP 2
68 o
69 binds an \f2ActivationSystem\fP to the name \f2java.rmi.activation.ActivationSystem\fP in this internal registry. 
70 .RE
71
72 .LP
73 .LP
74 To specify an alternate port for the registry, you must specify the \f2\-port\fP option when starting up \f2rmid\fP. For example,
75 .LP
76 .nf
77 \f3
78 .fl
79     rmid \-J\-Djava.security.policy=rmid.policy \-port 1099
80 .fl
81 \fP
82 .fi
83
84 .LP
85 .LP
86 starts the activation system daemon and a registry on the registry's default port, 1099.
87 .LP
88 .SS 
89 Starting rmid from inetd/xinetd
90 .LP
91 .LP
92 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.
93 .LP
94 .LP
95 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.
96 .LP
97 .LP
98 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:
99 .LP
100 .RS 3
101 .TP 2
102 o
103 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. 
104 .TP 2
105 o
106 The \f2\-port\fP option is disallowed. If this option is specified, \f2rmid\fP will exit with an error message. 
107 .TP 2
108 o
109 The \f2\-log\fP option is required. If this option is not specified, \f2rmid\fP will exit with an error message. 
110 .RE
111
112 .LP
113 .LP
114 See the man pages for \f2inetd\fP (Solaris) or \f2xinetd\fP (Linux) for details on how to configure services to be started on demand.
115 .LP
116 .SH "OPTIONS"
117 .LP
118
119 .LP
120 .RS 3
121 .TP 3
122 \-C<someCommandLineOption> 
123 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: 
124 .nf
125 \f3
126 .fl
127     rmid \-C\-Dsome.property=value
128 .fl
129 \fP
130 .fi
131 This ability to pass command\-line arguments to child processes can be useful for debugging. For example, the following command: 
132 .nf
133 \f3
134 .fl
135     rmid \-C\-Djava.rmi.server.logCalls=true
136 .fl
137 \fP
138 .fi
139 will enable server\-call logging in all child VMs. 
140 .LP
141 .TP 3
142 \-J<someCommandLineOption> 
143 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: 
144 .nf
145 \f3
146 .fl
147     rmid \-J\-Djava.security.policy=rmid.policy
148 .fl
149 \fP
150 .fi
151 .TP 3
152 \-J\-Dsun.rmi.activation.execPolicy=<policy> 
153 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: 
154 .LP
155 .RS 3
156 .TP 2
157 o
158 \f3default (or if this property is \fP\f4unspecified\fP\f3)\fP 
159 .LP
160 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. 
161 .LP
162 \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: 
163 .nf
164 \f3
165 .fl
166     \-D\fP\f4<property>\fP\f3=\fP\f4<value>\fP\f3
167 .fl
168 \fP
169 .fi
170 .LP
171 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. 
172 .LP
173 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). 
174 .RS 3
175 .TP 3
176 ExecPermission 
177 The \f2ExecPermission\fP class represents permission for \f2rmid\fP to execute a specific \f2command\fP to launch an activation group. 
178 .LP
179 \f3Syntax\fP
180 .br
181 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. 
182 .LP
183 \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.  
184 .TP 3
185 ExecOptionPermission 
186 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. 
187 .LP
188 \f3Syntax\fP
189 .br
190 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 "=". 
191 .LP
192 For example: "*" or "\-Dfoo.*" or "\-Da.b.c=*" is valid, "*foo" or "\-Da*b" or "ab*" is not.  
193 .TP 3
194 Policy file for rmid 
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). It is safe to grant these permissions universally because only \f2rmid\fP checks these permissions. 
196 .LP
197 An example policy file that grants various execute permissions to \f2rmid\fP is: 
198 .nf
199 \f3
200 .fl
201 grant {
202 .fl
203     permission com.sun.rmi.rmid.ExecPermission
204 .fl
205         "/files/apps/java/jdk1.2.2/solaris/bin/java";
206 .fl
207
208 .fl
209     permission com.sun.rmi.rmid.ExecPermission
210 .fl
211         "/files/apps/java/jdk1.2.2/solaris/bin/java_g";
212 .fl
213
214 .fl
215     permission com.sun.rmi.rmid.ExecPermission
216 .fl
217         "/files/apps/rmidcmds/*";
218 .fl
219
220 .fl
221     permission com.sun.rmi.rmid.ExecOptionPermission
222 .fl
223         "\-Djava.security.policy=/files/policies/group.policy";
224 .fl
225
226 .fl
227     permission com.sun.rmi.rmid.ExecOptionPermission
228 .fl
229         "\-Djava.security.debug=*";
230 .fl
231
232 .fl
233     permission com.sun.rmi.rmid.ExecOptionPermission
234 .fl
235         "\-Dsun.rmi.*";
236 .fl
237 };
238 .fl
239 \fP
240 .fi
241 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. 
242 .LP
243 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. 
244 .LP
245 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: 
246 .RS 3
247
248 .LP
249 .LP
250 \f2rmid \-J\-Djava.security.policy=rmid.policy\fP
251 .LP
252 .RE
253 .RE
254 .TP 2
255 o
256 .LP
257 .TP 2
258 o
259 \f4<policyClassName>\fP 
260 .LP
261 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. 
262 .LP
263 The \f2policyClassName\fP specifies a public class with a public, no\-argument constructor and an implementation of the following \f2checkExecCommand\fP method: 
264 .nf
265 \f3
266 .fl
267     public void checkExecCommand(ActivationGroupDesc desc,
268 .fl
269                                  String[] command)
270 .fl
271         throws SecurityException;
272 .fl
273 \fP
274 .fi
275 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. 
276 .LP
277 .TP 2
278 o
279 \f3none\fP 
280 .LP
281 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.  
282 .RE
283 .LP
284 .TP 3
285 \-log dir 
286 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. 
287 .LP
288 .TP 3
289 \-port port 
290 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: 
291 .nf
292 \f3
293 .fl
294     import java.rmi.*; 
295 .fl
296     import java.rmi.activation.*;
297 .fl
298
299 .fl
300     ActivationSystem system; system = (ActivationSystem)
301 .fl
302     Naming.lookup("//:\fP\f4port\fP/java.rmi.activation.ActivationSystem");
303 .fl
304 .fi
305 .TP 3
306 \-stop 
307 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. 
308 .RE
309 .SH "ENVIRONMENT VARIABLES"
310 .LP
311
312 .LP
313 .RS 3
314 .TP 3
315 CLASSPATH 
316 Used to provide the system a path to user\-defined classes. Directories are separated by colons. For example: 
317 .nf
318 \f3
319 .fl
320     .:/usr/local/java/classes
321 .fl
322 \fP
323 .fi
324 .RE
325
326 .LP
327 .SH "SEE ALSO"
328 .LP
329
330 .LP
331 .LP
332 rmic(1), 
333 .na
334 \f2CLASSPATH\fP @
335 .fi
336 http://java.sun.com/javase/6/docs/technotes/tools/index.html#classpath, java(1)
337 .LP
338