Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation.
This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
version 2 for more details (a copy is included in the LICENSE file that
accompanied this code).
You should have received a copy of the GNU General Public License version
2 along with this work; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.
Arch: generic
Software: JDK 8
Date: 21 November 2013
SectDesc: Remote Method Invocation (RMI) Tools
Title: rmid.1
* Define some portability stuff
-----------------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://bugs.debian.org/507673
http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------
* set default formatting
-----------------------------------------------------------------
disable hyphenation
disable justification (adjust text to left margin only)
-----------------------------------------------------------------
* MAIN CONTENT STARTS HERE *
-----------------------------------------------------------------
rmid [options]
options The command-line options. See Options.
Start the daemon by executing the \f3rmid command and specifying a security policy file, as follows:
\f3rmid -J-Djava.security.policy=rmid.policy
\f3When you run Oracle\(cqs implementation of the \f3rmid command, by default you must specify a security policy file so that the \f3rmid command can verify whether or not the information in each \f3ActivationGroupDesc is allowed to be used to start a JVM for an activation group. Specifically, the command and options specified by the \f3CommandEnvironment and any properties passed to an \f3ActivationGroupDesc constructor must now be explicitly allowed in the security policy file for the \f3rmid command. The value of the \f3sun.rmi.activation.execPolicy property dictates the policy that the \f3rmid command uses to determine whether or not the information in an \f3ActivationGroupDesc can be used to start a JVM for an activation group. For more information see the description of the -J-Dsun.rmi.activation.execPolicy=policy option.
Executing the \f3rmid command starts the Activator and an internal registry on the default port1098 and binds an \f3ActivationSystem to the name \f3java.rmi.activation.ActivationSystem in this internal registry.
To specify an alternate port for the registry, you must specify the \f3-port option when you execute the \f3rmid command. For example, the following command starts the activation system daemon and a registry on the registry's default port, 1099.
\f3rmid -J-Djava.security.policy=rmid.policy -port 1099
\f3
When RMID starts, it attempts to obtain an inherited channel (inherited from \f3inetd/\f3xinetd) by calling the \f3System.inheritedChannel method. If the inherited channel is null or not an instance of \f3java.nio.channels.ServerSocketChannel, then RMID assumes that it was not started by \f3inetd/\f3xinetd, and it starts as previously described.
If the inherited channel is a \f3ServerSocketChannel instance, then RMID uses the \f3java.net.ServerSocket obtained from the \f3ServerSocketChannel as the server socket that accepts requests for the remote objects it exports: The registry in which the \f3java.rmi.activation.ActivationSystem is bound and the \f3java.rmi.activation.Activator remote object. In this mode, RMID behaves the same as when it is started from the command line, except in the following cases:
0.2i Output printed to \f3System.err is redirected to a file. This file is located in the directory specified by the \f3java.io.tmpdir system property (typically \f3/var/tmp or \f3/tmp) with the prefix \f3rmid-err and the suffix \f3tmp.
0.2i The \f3-port option is not allowed. If this option is specified, then RMID exits with an error message.
0.2i The \f3-log option is required. If this option is not specified, then RMID exits with an error message
See the man pages for \f3inetd (Oracle Solaris) or \f3xinetd (Linux) for details on how to configure services to be started on demand.
-Coption
Specifies an option that is passed as a command-line argument to each child process (activation group) of the \f3rmid command when that process is created. For example, you could pass a property to each virtual machine spawned by the activation system daemon:
\f3rmid -C-Dsome.property=value
\f3This ability to pass command-line arguments to child processes can be useful for debugging. For example, the following command enables server-call logging in all child JVMs.
\f3rmid -C-Djava.rmi.server.logCalls=true
\f3
-Joption
Specifies an option that is passed to the Java interpreter running RMID. For example, to specify that the \f3rmid command use a policy file named \f3rmid.policy, the \f3-J option can be used to define the \f3java.security.policy property on the \f3rmid command line, for example:
\f3rmid -J-Djava.security.policy-rmid.policy
\f3
-J-Dsun.rmi.activation.execPolicy=policy
Specifies the policy that RMID employs to check commands and command-line options used to start the JVM in which an activation group runs. Please note that this option exists only in Oracle's implementation of the Java RMI activation daemon. If this property is not specified on the command line, then the result is the same as though \f3-J-Dsun.rmi.activation.execPolicy=default were specified. The possible values of \f3policy can be \f3default, \f3policyClassName, or \f3none.
0.2i default The \f3default or unspecified value \f3execPolicy allows the \f3rmid command to execute commands with specific command-line options only when the \f3rmid command was granted permission to execute those commands and options in the security policy file that the \f3rmid command uses. Only the default activation group implementation can be used with the default execution policy. The \f3rmid command starts a JVM for an activation group with the information in the group's registered activation group descriptor, an \f3ActivationGroupDesc. The group descriptor specifies an optional \f3ActivationGroupDesc.CommandEnvironment that includes the command to execute to start the activation group and any command-line options to be added to the command line. By default, the \f3rmid command uses the \f3java command found in \f3java.home. The group descriptor also contains properties overrides that are added to the command line as options defined as: \f3-D<property>=<value>.The \f3com.sun.rmi.rmid.ExecPermission permission grants the \f3rmid command permission to execute a command that is specified in the group descriptor's \f3CommandEnvironment to start an activation group. The \f3com.sun.rmi.rmid.ExecOptionPermission permission enables the \f3rmid command to use command-line options, specified as properties overrides in the group descriptor or as options in the \f3CommandEnvironment when starting the activation group.When granting the \f3rmid command permission to execute various commands and options, the permissions \f3ExecPermission and \f3ExecOptionPermission must be granted to all code sources. ExecPermission The \f3ExecPermission class represents permission for the \f3rmid command to execute a specific command to start an activation group. Syntax: The name of an \f3ExecPermission is the path name of a command to grant the \f3rmid command permission to execute. A path name that ends in a slash (/) and an asterisk (*) indicates that all of the files contained in that directory where slash is the file-separator character, \f3File.separatorChar. A path name that ends in a slash (/) and a minus sign (-) indicates all files and subdirectories contained in that directory (recursively). A path name that consists of the special token \f3<<ALL FILES>> matches any file. A path name that consists of an asterisk (*) indicates all the files in the current directory. A path name that consists of a minus sign (-) indicates all the files in the current directory and (recursively) all files and subdirectories contained in the current directory. ExecOptionPermission The \f3ExecOptionPermission class represents permission for the \f3rmid command to use a specific command-line option when starting an activation group. The name of an \f3ExecOptionPermission is the value of a command-line option. Syntax: Options support a limited wild card scheme. An asterisk signifies a wild card match, and it can appear as the option name itself (matches any option), or an asterisk (*) can appear at the end of the option name only when the asterisk (*) follows a dot (.) or an equals sign (=). For example: \f3* or \f3-Dmydir.* or \f3-Da.b.c=* is valid, but \f3*mydir or \f3-Da*b or \f3ab* is not. Policy file for rmid When you grant the \f3rmid command permission to execute various commands and options, the permissions \f3ExecPermission and \f3ExecOptionPermission must be granted to all code sources (universally). It is safe to grant these permissions universally because only the \f3rmid command checks these permissions. An example policy file that grants various execute permissions to the \f3rmid command is:
\f3grant {
\f3 permission com.sun.rmi.rmid.ExecPermission
\f3 "/files/apps/java/jdk1.7.0/solaris/bin/java";
\f3
\f3 permission com.sun.rmi.rmid.ExecPermission
\f3 "/files/apps/rmidcmds/*";
\f3
\f3 permission com.sun.rmi.rmid.ExecOptionPermission
\f3 "-Djava.security.policy=/files/policies/group.policy";
\f3
\f3 permission com.sun.rmi.rmid.ExecOptionPermission
\f3 "-Djava.security.debug=*";
\f3
\f3 permission com.sun.rmi.rmid.ExecOptionPermission
\f3 "-Dsun.rmi.*";
\f3};
\f3The first permission granted allows the \f3rmid tcommand o execute the 1.7.0 release of the \f3java command, specified by its explicit path name. By default, the version of the \f3java command found in \f3java.home is used (the same one that the \f3rmid command uses), and does not need to be specified in the policy file. The second permission allows the \f3rmid command to execute any command in the directory \f3/files/apps/rmidcmds. The third permission granted, an \f3ExecOptionPermission, allows the \f3rmid command to start an activation group that defines the security policy file to be \f3/files/policies/group.policy. The next permission allows the \f3java.security.debug property to be used by an activation group. The last permission allows any property in the \f3sun.rmi property name hierarchy to be used by activation groups. To start the \f3rmid command with a policy file, the \f3java.security.policy property needs to be specified on the \f3rmid command line, for example: \f3rmid -J-Djava.security.policy=rmid.policy.
0.2i <policyClassName> If the default behavior is not flexible enough, then an administrator can provide, when starting the \f3rmid command, the name of a class whose \f3checkExecCommand method is executed to check commands to be executed by the \f3rmid command. The \f3policyClassName specifies a public class with a public, no-argument constructor and an implementation of the following \f3checkExecCommand method:
\f3 public void checkExecCommand(ActivationGroupDesc desc, String[] command)
\f3 throws SecurityException;
\f3Before starting an activation group, the \f3rmid command calls the policy's \f3checkExecCommand method and passes to it the activation group descriptor and an array that contains the complete command to start the activation group. If the \f3checkExecCommand throws a \f3SecurityException, then the \f3rmid command does not start the activation group and an \f3ActivationException is thrown to the caller attempting to activate the object.
0.2i none If the \f3sun.rmi.activation.execPolicy property value is \f3none, then the \f3rmid command does not perform any validation of commands to start activation groups.
-log dir
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 log, in the directory in which the \f3rmid command was executed.
-port port
Specifies the port the registry uses. The activation system daemon binds the \f3ActivationSystem, with the name \f3java.rmi.activation.ActivationSystem, in this registry. The \f3ActivationSystem on the local machine can be obtained using the following \f3Naming.lookup method call:
\f3import java.rmi.*;
\f3 import java.rmi.activation.*;
\f3
\f3 ActivationSystem system; system = (ActivationSystem)
\f3 Naming.lookup("//:port/java.rmi.activation.ActivationSystem");
\f3
-stop
Stops the current invocation of the \f3rmid command for a port specified by the \f3-port option. If no port is specified, then this option stops the \f3rmid invocation running on port 1098.
CLASSPATH Used to provide the system a path to user-defined classes. Directories are separated by colons, for example: \f3.:/usr/local/java/classes.
0.2i java(1)
0.2i Setting the Class Path
'pl 8.5i 'bp