blob: 06147c951015baf398e2b43c9b9f3c2e5fc6ebd1 [file] [log] [blame]
tbell16c34dd2009-05-04 18:28:26 -07001." Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved.
duke6e45e102007-12-01 00:00:00 +00002." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3."
4." This code is free software; you can redistribute it and/or modify it
5." under the terms of the GNU General Public License version 2 only, as
6." published by the Free Software Foundation.
7."
8." This code is distributed in the hope that it will be useful, but WITHOUT
9." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11." version 2 for more details (a copy is included in the LICENSE file that
12." accompanied this code).
13."
14." You should have received a copy of the GNU General Public License version
15." 2 along with this work; if not, write to the Free Software Foundation,
16." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17."
18." Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
19." CA 95054 USA or visit www.sun.com if you need additional information or
20." have any questions.
tbell16c34dd2009-05-04 18:28:26 -070021."
22.TH rmid 1 "04 May 2009"
23." Generated from HTML by html2man (author: Eric Armstrong)
24
duke6e45e102007-12-01 00:00:00 +000025.LP
tbell16c34dd2009-05-04 18:28:26 -070026.SH "Name"
duke6e45e102007-12-01 00:00:00 +000027rmid \- The Java RMI Activation System Daemon
28.LP
tbell16c34dd2009-05-04 18:28:26 -070029.RS 3
duke6e45e102007-12-01 00:00:00 +000030
31.LP
32.LP
33\f3rmid\fP starts the activation system daemon that allows objects to be registered and activated in a virtual machine (VM).
34.LP
tbell16c34dd2009-05-04 18:28:26 -070035.RE
duke6e45e102007-12-01 00:00:00 +000036.SH "SYNOPSIS"
37.LP
38
39.LP
40.nf
41\f3
42.fl
43rmid [options]
44.fl
45\fP
46.fi
47
48.LP
49.SH "DESCRIPTION"
50.LP
51
52.LP
53.LP
54The \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
55.na
56\f2Java RMI Specification\fP @
57.fi
tbell16c34dd2009-05-04 18:28:26 -070058http://java.sun.com/javase/6/docs/platform/rmi/spec/rmiTOC.html and
duke6e45e102007-12-01 00:00:00 +000059.na
60\f2Activation tutorials\fP @
61.fi
62http://java.sun.com/javase/6/docs/technotes/guides/rmi/activation/overview.html for details on how to write programs that use activatable remote objects.
63.LP
64.LP
65The daemon can be started by executing the \f2rmid\fP command, and specifying a security policy file, as follows:
66.LP
67.nf
68\f3
69.fl
70 rmid \-J\-Djava.security.policy=rmid.policy
71.fl
72\fP
73.fi
74
75.LP
76.LP
77\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.
78.LP
79.LP
80Executing \f2rmid\fP by default
81.LP
82.RS 3
83.TP 2
tbell16c34dd2009-05-04 18:28:26 -070084o
duke6e45e102007-12-01 00:00:00 +000085starts the Activator and an internal registry on the default port, 1098, and
86.TP 2
tbell16c34dd2009-05-04 18:28:26 -070087o
duke6e45e102007-12-01 00:00:00 +000088binds an \f2ActivationSystem\fP to the name \f2java.rmi.activation.ActivationSystem\fP in this internal registry.
89.RE
90
91.LP
92.LP
93To specify an alternate port for the registry, you must specify the \f2\-port\fP option when starting up \f2rmid\fP. For example,
94.LP
95.nf
96\f3
97.fl
98 rmid \-J\-Djava.security.policy=rmid.policy \-port 1099
99.fl
100\fP
101.fi
102
103.LP
104.LP
105starts the activation system daemon and a registry on the registry's default port, 1099.
106.LP
107.SS
tbell16c34dd2009-05-04 18:28:26 -0700108Starting rmid from inetd/xinetd
duke6e45e102007-12-01 00:00:00 +0000109.LP
110.LP
111An 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.
112.LP
113.LP
114When \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.
115.LP
116.LP
117If 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:
118.LP
119.RS 3
120.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700121o
duke6e45e102007-12-01 00:00:00 +0000122Output 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.
123.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700124o
duke6e45e102007-12-01 00:00:00 +0000125The \f2\-port\fP option is disallowed. If this option is specified, \f2rmid\fP will exit with an error message.
126.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700127o
duke6e45e102007-12-01 00:00:00 +0000128The \f2\-log\fP option is required. If this option is not specified, \f2rmid\fP will exit with an error message.
129.RE
130
131.LP
132.LP
133See the man pages for \f2inetd\fP (Solaris) or \f2xinetd\fP (Linux) for details on how to configure services to be started on demand.
134.LP
135.SH "OPTIONS"
136.LP
137
138.LP
tbell16c34dd2009-05-04 18:28:26 -0700139.RS 3
duke6e45e102007-12-01 00:00:00 +0000140.TP 3
141\-C<someCommandLineOption>
142Specifies 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:
143.nf
144\f3
145.fl
146 rmid \-C\-Dsome.property=value
147.fl
148\fP
149.fi
150This ability to pass command\-line arguments to child processes can be useful for debugging. For example, the following command:
151.nf
152\f3
153.fl
154 rmid \-C\-Djava.rmi.server.logCalls=true
155.fl
156\fP
157.fi
158will enable server\-call logging in all child VMs.
159.LP
160.TP 3
161\-J<someCommandLineOption>
162Specifies 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:
163.nf
164\f3
165.fl
166 rmid \-J\-Djava.security.policy=rmid.policy
167.fl
168\fP
169.fi
170.TP 3
duke6e45e102007-12-01 00:00:00 +0000171\-J\-Dsun.rmi.activation.execPolicy=<policy>
172Specifies 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:
173.LP
174.RS 3
175.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700176o
duke6e45e102007-12-01 00:00:00 +0000177\f3default (or if this property is \fP\f4unspecified\fP\f3)\fP
178.LP
179The 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.
180.LP
181\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:
182.nf
183\f3
184.fl
185 \-D\fP\f4<property>\fP\f3=\fP\f4<value>\fP\f3
186.fl
187\fP
188.fi
189.LP
190The 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.
191.LP
tbell16c34dd2009-05-04 18:28:26 -0700192When 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).
193.RS 3
duke6e45e102007-12-01 00:00:00 +0000194.TP 3
195ExecPermission
196The \f2ExecPermission\fP class represents permission for \f2rmid\fP to execute a specific \f2command\fP to launch an activation group.
197.LP
198\f3Syntax\fP
199.br
200The \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.
201.LP
202\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.
203.TP 3
204ExecOptionPermission
205The \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.
206.LP
207\f3Syntax\fP
208.br
209Options 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 "=".
210.LP
211For example: "*" or "\-Dfoo.*" or "\-Da.b.c=*" is valid, "*foo" or "\-Da*b" or "ab*" is not.
212.TP 3
tbell16c34dd2009-05-04 18:28:26 -0700213Policy file for rmid
duke6e45e102007-12-01 00:00:00 +0000214When 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.
215.LP
216An example policy file that grants various execute permissions to \f2rmid\fP is:
217.nf
218\f3
219.fl
220grant {
221.fl
222 permission com.sun.rmi.rmid.ExecPermission
223.fl
tbell16c34dd2009-05-04 18:28:26 -0700224 "/files/apps/java/jdk1.7.0/solaris/bin/java";
duke6e45e102007-12-01 00:00:00 +0000225.fl
226
227.fl
228 permission com.sun.rmi.rmid.ExecPermission
229.fl
230 "/files/apps/rmidcmds/*";
231.fl
232
233.fl
234 permission com.sun.rmi.rmid.ExecOptionPermission
235.fl
236 "\-Djava.security.policy=/files/policies/group.policy";
237.fl
238
239.fl
240 permission com.sun.rmi.rmid.ExecOptionPermission
241.fl
242 "\-Djava.security.debug=*";
243.fl
244
245.fl
246 permission com.sun.rmi.rmid.ExecOptionPermission
247.fl
248 "\-Dsun.rmi.*";
249.fl
250};
251.fl
252\fP
253.fi
tbell16c34dd2009-05-04 18:28:26 -0700254The first permission granted allow \f2rmid\fP to execute the 1.7.0 version of the \f2java\fP command, specified by its explicit path name. 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 second permission allows \f2rmid\fP to execute any command in the directory \f2/files/apps/rmidcmds\fP.
duke6e45e102007-12-01 00:00:00 +0000255.LP
tbell16c34dd2009-05-04 18:28:26 -0700256The third 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.
duke6e45e102007-12-01 00:00:00 +0000257.LP
258To 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:
259.RS 3
260
261.LP
262.LP
263\f2rmid \-J\-Djava.security.policy=rmid.policy\fP
264.LP
265.RE
tbell16c34dd2009-05-04 18:28:26 -0700266.RE
duke6e45e102007-12-01 00:00:00 +0000267.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700268o
269.LP
duke6e45e102007-12-01 00:00:00 +0000270.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700271o
duke6e45e102007-12-01 00:00:00 +0000272\f4<policyClassName>\fP
273.LP
274If 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.
275.LP
276The \f2policyClassName\fP specifies a public class with a public, no\-argument constructor and an implementation of the following \f2checkExecCommand\fP method:
277.nf
278\f3
279.fl
280 public void checkExecCommand(ActivationGroupDesc desc,
281.fl
282 String[] command)
283.fl
284 throws SecurityException;
285.fl
286\fP
287.fi
288Before 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.
289.LP
290.TP 2
tbell16c34dd2009-05-04 18:28:26 -0700291o
duke6e45e102007-12-01 00:00:00 +0000292\f3none\fP
293.LP
294If the \f2sun.rmi.activation.execPolicy\fP property value is "none", then \f2rmid\fP will not perform any validation of commands to launch activation groups.
295.RE
tbell16c34dd2009-05-04 18:28:26 -0700296.LP
duke6e45e102007-12-01 00:00:00 +0000297.TP 3
298\-log dir
299Specifies 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.
tbell16c34dd2009-05-04 18:28:26 -0700300.LP
duke6e45e102007-12-01 00:00:00 +0000301.TP 3
302\-port port
303Specifies 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:
304.nf
305\f3
306.fl
307 import java.rmi.*;
308.fl
309 import java.rmi.activation.*;
310.fl
311
312.fl
313 ActivationSystem system; system = (ActivationSystem)
314.fl
315 Naming.lookup("//:\fP\f4port\fP/java.rmi.activation.ActivationSystem");
316.fl
317.fi
318.TP 3
319\-stop
tbell16c34dd2009-05-04 18:28:26 -0700320Stops 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.
321.RE
duke6e45e102007-12-01 00:00:00 +0000322.SH "ENVIRONMENT VARIABLES"
323.LP
324
325.LP
tbell16c34dd2009-05-04 18:28:26 -0700326.RS 3
duke6e45e102007-12-01 00:00:00 +0000327.TP 3
328CLASSPATH
329Used to provide the system a path to user\-defined classes. Directories are separated by colons. For example:
330.nf
331\f3
332.fl
333 .:/usr/local/java/classes
334.fl
335\fP
336.fi
tbell16c34dd2009-05-04 18:28:26 -0700337.RE
duke6e45e102007-12-01 00:00:00 +0000338
339.LP
340.SH "SEE ALSO"
341.LP
342
343.LP
344.LP
tbell16c34dd2009-05-04 18:28:26 -0700345rmic(1),
346.na
347\f2CLASSPATH\fP @
348.fi
349http://java.sun.com/javase/6/docs/technotes/tools/index.html#classpath, java(1)
duke6e45e102007-12-01 00:00:00 +0000350.LP
351
352.LP
353