jdk/src/linux/doc/man/rmid.1
changeset 21743 3d979da7bdf0
parent 9573 c02ff5a7c67b
child 31876 91b22707521a
equal deleted inserted replaced
21741:8cd632761233 21743:3d979da7bdf0
     1 ." Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
     1 '\" t
     2 ." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2 .\"  Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     3 ."
     3 .\"
     4 ." This code is free software; you can redistribute it and/or modify it
     4 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5 ." under the terms of the GNU General Public License version 2 only, as
     5 .\"
     6 ." published by the Free Software Foundation.
     6 .\" This code is free software; you can redistribute it and/or modify it
     7 ."
     7 .\" under the terms of the GNU General Public License version 2 only, as
     8 ." This code is distributed in the hope that it will be useful, but WITHOUT
     8 .\" published by the Free Software Foundation.
     9 ." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     9 .\"
    10 ." FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    10 .\" This code is distributed in the hope that it will be useful, but WITHOUT
    11 ." version 2 for more details (a copy is included in the LICENSE file that
    11 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    12 ." accompanied this code).
    12 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
    13 ."
    13 .\" version 2 for more details (a copy is included in the LICENSE file that
    14 ." You should have received a copy of the GNU General Public License version
    14 .\" accompanied this code).
    15 ." 2 along with this work; if not, write to the Free Software Foundation,
    15 .\"
    16 ." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    16 .\" You should have received a copy of the GNU General Public License version
    17 ."
    17 .\" 2 along with this work; if not, write to the Free Software Foundation,
    18 ." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    18 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    19 ." or visit www.oracle.com if you need additional information or have any
    19 .\"
    20 ." questions.
    20 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    21 ."
    21 .\" or visit www.oracle.com if you need additional information or have any
    22 .TH rmid 1 "10 May 2011"
    22 .\" questions.
    23 
    23 .\"
    24 .LP
    24 .\"     Arch: generic
    25 .SH "Name"
    25 .\"     Software: JDK 8
    26 rmid \- The Java RMI Activation System Daemon
    26 .\"     Date: 21 November 2013
    27 .LP
    27 .\"     SectDesc: Remote Method Invocation (RMI) Tools
    28 .LP
    28 .\"     Title: rmid.1
    29 \f3rmid\fP starts the activation system daemon that allows objects to be registered and activated in a virtual machine (VM).
    29 .\"
    30 .LP
    30 .if n .pl 99999
    31 .SH "SYNOPSIS"
    31 .TH rmid 1 "21 November 2013" "JDK 8" "Remote Method Invocation (RMI) Tools"
    32 .LP
    32 .\" -----------------------------------------------------------------
    33 .nf
    33 .\" * Define some portability stuff
    34 \f3
    34 .\" -----------------------------------------------------------------
    35 .fl
    35 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    36 rmid [options]
    36 .\" http://bugs.debian.org/507673
    37 .fl
    37 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
    38 \fP
    38 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    39 .fi
    39 .ie \n(.g .ds Aq \(aq
    40 
    40 .el       .ds Aq '
    41 .LP
    41 .\" -----------------------------------------------------------------
    42 .SH "DESCRIPTION"
    42 .\" * set default formatting
    43 .LP
    43 .\" -----------------------------------------------------------------
    44 .LP
    44 .\" disable hyphenation
    45 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 
    45 .nh
    46 .na
    46 .\" disable justification (adjust text to left margin only)
    47 \f2Java RMI Specification\fP @
    47 .ad l
    48 .fi
    48 .\" -----------------------------------------------------------------
    49 http://download.oracle.com/javase/7/docs/platform/rmi/spec/rmiTOC.html and 
    49 .\" * MAIN CONTENT STARTS HERE *
    50 .na
    50 .\" -----------------------------------------------------------------
    51 \f2Activation tutorials\fP @
    51 
    52 .fi
    52 .SH NAME    
    53 http://download.oracle.com/javase/7/docs/technotes/guides/rmi/activation/overview.html for details on how to write programs that use activatable remote objects.
    53 rmid \- Starts the activation system daemon that enables objects to be registered and activated in a Java Virtual Machine (JVM)\&.
    54 .LP
    54 .SH SYNOPSIS    
    55 .LP
    55 .sp     
    56 The daemon can be started by executing the \f2rmid\fP command, and specifying a security policy file, as follows:
    56 .nf     
    57 .LP
    57 
    58 .nf
    58 \fBrmid\fR [\fIoptions\fR]
    59 \f3
    59 .fi     
    60 .fl
    60 .sp     
    61     rmid \-J\-Djava.security.policy=rmid.policy
    61 .TP     
    62 .fl
    62 \fIoptions\fR
    63 \fP
    63 The command-line options\&. See Options\&.
    64 .fi
    64 .SH DESCRIPTION    
    65 
    65 The \f3rmid\fR command 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 JVM\&. For details on how to write programs that use activatable objects, the \fIUsing Activation\fR tutorial at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi/activation/overview\&.html
    66 .LP
    66 .PP
    67 .LP
    67 Start the daemon by executing the \f3rmid\fR command and specifying a security policy file, as follows:
    68 \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.
    68 .sp     
    69 .LP
    69 .nf     
    70 .LP
    70 \f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy\fP
    71 Executing \f2rmid\fP by default
    71 .fi     
    72 .LP
    72 .nf     
    73 .RS 3
    73 \f3\fP
    74 .TP 2
    74 .fi     
    75 o
    75 .sp     
    76 starts the Activator and an internal registry on the default port, 1098, and 
    76 When you run Oracle\(cqs implementation of the \f3rmid\fR command, by default you must specify a security policy file so that the \f3rmid\fR command can verify whether or not the information in each \f3ActivationGroupDesc\fR is allowed to be used to start a JVM for an activation group\&. Specifically, the command and options specified by the \f3CommandEnvironment\fR and any properties passed to an \f3ActivationGroupDesc\fR constructor must now be explicitly allowed in the security policy file for the \f3rmid\fR command\&. The value of the \f3sun\&.rmi\&.activation\&.execPolicy\fR property dictates the policy that the \f3rmid\fR command uses to determine whether or not the information in an \f3ActivationGroupDesc\fR 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\&.
    77 .TP 2
    77 .PP
    78 o
    78 Executing the \f3rmid\fR command starts the Activator and an internal registry on the default port1098 and binds an \f3ActivationSystem\fR to the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR in this internal registry\&.
    79 binds an \f2ActivationSystem\fP to the name \f2java.rmi.activation.ActivationSystem\fP in this internal registry. 
    79 .PP
       
    80 To specify an alternate port for the registry, you must specify the \f3-port\fR option when you execute the \f3rmid\fR command\&. For example, the following command starts the activation system daemon and a registry on the registry\&'s default port, 1099\&.
       
    81 .sp     
       
    82 .nf     
       
    83 \f3rmid \-J\-Djava\&.security\&.policy=rmid\&.policy \-port 1099\fP
       
    84 .fi     
       
    85 .nf     
       
    86 \f3\fP
       
    87 .fi     
       
    88 .sp     
       
    89 .SH START\ RMID\ ON\ DEMAND    
       
    90 An alternative to starting \f3rmid\fR from the command line is to configure \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) to start \f3rmid\fR on demand\&.
       
    91 .PP
       
    92 When RMID starts, it attempts to obtain an inherited channel (inherited from \f3inetd\fR/\f3xinetd\fR) by calling the \f3System\&.inheritedChannel\fR method\&. If the inherited channel is null or not an instance of \f3java\&.nio\&.channels\&.ServerSocketChannel\fR, then RMID assumes that it was not started by \f3inetd\fR/\f3xinetd\fR, and it starts as previously described\&.
       
    93 .PP
       
    94 If the inherited channel is a \f3ServerSocketChannel\fR instance, then RMID uses the \f3java\&.net\&.ServerSocket\fR obtained from the \f3ServerSocketChannel\fR as the server socket that accepts requests for the remote objects it exports: The registry in which the \f3java\&.rmi\&.activation\&.ActivationSystem\fR is bound and the \f3java\&.rmi\&.activation\&.Activator\fR remote object\&. In this mode, RMID behaves the same as when it is started from the command line, except in the following cases:
       
    95 .TP 0.2i    
       
    96 \(bu
       
    97 Output printed to \f3System\&.err\fR is redirected to a file\&. This file is located in the directory specified by the \f3java\&.io\&.tmpdir\fR system property (typically \f3/var/tmp\fR or \f3/tmp\fR) with the prefix \f3rmid-err\fR and the suffix \f3tmp\fR\&.
       
    98 .TP 0.2i    
       
    99 \(bu
       
   100 The \f3-port\fR option is not allowed\&. If this option is specified, then RMID exits with an error message\&.
       
   101 .TP 0.2i    
       
   102 \(bu
       
   103 The \f3-log\fR option is required\&. If this option is not specified, then RMID exits with an error message
       
   104 .PP
       
   105 See the man pages for \f3inetd\fR (Oracle Solaris) or \f3xinetd\fR (Linux) for details on how to configure services to be started on demand\&.
       
   106 .SH OPTIONS    
       
   107 .TP
       
   108 -C\fIoption\fR
       
   109 .br
       
   110 Specifies an option that is passed as a command-line argument to each child process (activation group) of the \f3rmid\fR command when that process is created\&. For example, you could pass a property to each virtual machine spawned by the activation system daemon:
       
   111 .sp     
       
   112 .nf     
       
   113 \f3rmid \-C\-Dsome\&.property=value\fP
       
   114 .fi     
       
   115 .nf     
       
   116 \f3\fP
       
   117 .fi     
       
   118 .sp     
       
   119 
       
   120 
       
   121 This 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\&.
       
   122 .sp     
       
   123 .nf     
       
   124 \f3rmid \-C\-Djava\&.rmi\&.server\&.logCalls=true\fP
       
   125 .fi     
       
   126 .nf     
       
   127 \f3\fP
       
   128 .fi     
       
   129 .sp     
       
   130 
       
   131 .TP
       
   132 -J\fIoption\fR
       
   133 .br
       
   134 Specifies an option that is passed to the Java interpreter running RMID\&. For example, to specify that the \f3rmid\fR command use a policy file named \f3rmid\&.policy\fR, the \f3-J\fR option can be used to define the \f3java\&.security\&.policy\fR property on the \f3rmid\fR command line, for example:
       
   135 .sp     
       
   136 .nf     
       
   137 \f3rmid \-J\-Djava\&.security\&.policy\-rmid\&.policy\fP
       
   138 .fi     
       
   139 .nf     
       
   140 \f3\fP
       
   141 .fi     
       
   142 .sp     
       
   143 
       
   144 .TP
       
   145 -J-Dsun\&.rmi\&.activation\&.execPolicy=\fIpolicy\fR
       
   146 .br
       
   147 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\fR were specified\&. The possible values of \f3policy\fR can be \f3default\fR, \f3policyClassName\fR, or \f3none\fR\&.
       
   148 .RS     
       
   149 .TP 0.2i    
       
   150 \(bu
       
   151 default
       
   152 
       
   153 The \f3default\fR or unspecified value \f3execPolicy\fR allows the \f3rmid\fR command to execute commands with specific command-line options only when the \f3rmid\fR command was granted permission to execute those commands and options in the security policy file that the \f3rmid\fR command uses\&. Only the default activation group implementation can be used with the default execution policy\&.
       
   154 
       
   155 The \f3rmid\fR command starts a JVM for an activation group with the information in the group\&'s registered activation group descriptor, an \f3ActivationGroupDesc\fR\&. The group descriptor specifies an optional \f3ActivationGroupDesc\&.CommandEnvironment\fR 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\fR command uses the \f3java\fR command found in \f3java\&.home\fR\&. The group descriptor also contains properties overrides that are added to the command line as options defined as: \f3-D<property>=<value>\fR\&.The \f3com\&.sun\&.rmi\&.rmid\&.ExecPermission\fR permission grants the \f3rmid\fR command permission to execute a command that is specified in the group descriptor\&'s \f3CommandEnvironment\fR to start an activation group\&. The \f3com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fR permission enables the \f3rmid\fR command to use command-line options, specified as properties overrides in the group descriptor or as options in the \f3CommandEnvironment\fR when starting the activation group\&.When granting the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources\&.
       
   156 
       
   157 \fIExecPermission\fR
       
   158 
       
   159 The \f3ExecPermission\fR class represents permission for the \f3rmid\fR command to execute a specific command to start an activation group\&.
       
   160 
       
   161 \fISyntax\fR: The name of an \f3ExecPermission\fR is the path name of a command to grant the \f3rmid\fR 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\fR\&. 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>>\fR matches any file\&.
       
   162 
       
   163 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\&.
       
   164 
       
   165 \fIExecOptionPermission\fR
       
   166 
       
   167 The \f3ExecOptionPermission\fR class represents permission for the \f3rmid\fR command to use a specific command-line option when starting an activation group\&. The name of an \f3ExecOptionPermission\fR is the value of a command-line option\&.
       
   168 
       
   169 \fISyntax\fR: 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 (=)\&.
       
   170 
       
   171 For example: \f3*\fR or \f3-Dmydir\&.*\fR or \f3-Da\&.b\&.c=*\fR is valid, but \f3*mydir\fR or \f3-Da*b\fR or \f3ab*\fR is not\&.
       
   172 
       
   173 \fIPolicy file for rmid\fR
       
   174 
       
   175 When you grant the \f3rmid\fR command permission to execute various commands and options, the permissions \f3ExecPermission\fR and \f3ExecOptionPermission\fR must be granted to all code sources (universally)\&. It is safe to grant these permissions universally because only the \f3rmid\fR command checks these permissions\&.
       
   176 
       
   177 An example policy file that grants various execute permissions to the \f3rmid\fR command is:
       
   178 .sp     
       
   179 .nf     
       
   180 \f3grant {\fP
       
   181 .fi     
       
   182 .nf     
       
   183 \f3    permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
       
   184 .fi     
       
   185 .nf     
       
   186 \f3        "/files/apps/java/jdk1\&.7\&.0/solaris/bin/java";\fP
       
   187 .fi     
       
   188 .nf     
       
   189 \f3\fP
       
   190 .fi     
       
   191 .nf     
       
   192 \f3    permission com\&.sun\&.rmi\&.rmid\&.ExecPermission\fP
       
   193 .fi     
       
   194 .nf     
       
   195 \f3        "/files/apps/rmidcmds/*";\fP
       
   196 .fi     
       
   197 .nf     
       
   198 \f3\fP
       
   199 .fi     
       
   200 .nf     
       
   201 \f3    permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
       
   202 .fi     
       
   203 .nf     
       
   204 \f3        "\-Djava\&.security\&.policy=/files/policies/group\&.policy";\fP
       
   205 .fi     
       
   206 .nf     
       
   207 \f3\fP
       
   208 .fi     
       
   209 .nf     
       
   210 \f3    permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
       
   211 .fi     
       
   212 .nf     
       
   213 \f3        "\-Djava\&.security\&.debug=*";\fP
       
   214 .fi     
       
   215 .nf     
       
   216 \f3\fP
       
   217 .fi     
       
   218 .nf     
       
   219 \f3    permission com\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fP
       
   220 .fi     
       
   221 .nf     
       
   222 \f3        "\-Dsun\&.rmi\&.*";\fP
       
   223 .fi     
       
   224 .nf     
       
   225 \f3};\fP
       
   226 .fi     
       
   227 .nf     
       
   228 \f3\fP
       
   229 .fi     
       
   230 .sp     
       
   231 
       
   232 
       
   233 The first permission granted allows the \f3rmid\fR tcommand o execute the 1\&.7\&.0 release of the \f3java\fR command, specified by its explicit path name\&. By default, the version of the \f3java\fR command found in \f3java\&.home\fR is used (the same one that the \f3rmid\fR command uses), and does not need to be specified in the policy file\&. The second permission allows the \f3rmid\fR command to execute any command in the directory \f3/files/apps/rmidcmds\fR\&.
       
   234 
       
   235 The third permission granted, an \f3ExecOptionPermission\fR, allows the \f3rmid\fR command to start an activation group that defines the security policy file to be \f3/files/policies/group\&.policy\fR\&. The next permission allows the \f3java\&.security\&.debug property\fR to be used by an activation group\&. The last permission allows any property in the \f3sun\&.rmi property\fR name hierarchy to be used by activation groups\&.
       
   236 
       
   237 To start the \f3rmid\fR command with a policy file, the \f3java\&.security\&.policy\fR property needs to be specified on the \f3rmid\fR command line, for example:
       
   238 
       
   239 \f3rmid -J-Djava\&.security\&.policy=rmid\&.policy\fR\&.
       
   240 .TP 0.2i    
       
   241 \(bu
       
   242 <policyClassName>
       
   243 
       
   244 If the default behavior is not flexible enough, then an administrator can provide, when starting the \f3rmid\fR command, the name of a class whose \f3checkExecCommand\fR method is executed to check commands to be executed by the \f3rmid\fR command\&.
       
   245 
       
   246 The \f3policyClassName\fR specifies a public class with a public, no-argument constructor and an implementation of the following \f3checkExecCommand\fR method:
       
   247 .sp     
       
   248 .nf     
       
   249 \f3 public void checkExecCommand(ActivationGroupDesc desc, String[] command)\fP
       
   250 .fi     
       
   251 .nf     
       
   252 \f3        throws SecurityException;\fP
       
   253 .fi     
       
   254 .nf     
       
   255 \f3\fP
       
   256 .fi     
       
   257 .sp     
       
   258 
       
   259 
       
   260 Before starting an activation group, the \f3rmid\fR command calls the policy\&'s \f3checkExecCommand\fR 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\fR throws a \f3SecurityException\fR, then the \f3rmid\fR command does not start the activation group and an \f3ActivationException\fR is thrown to the caller attempting to activate the object\&.
       
   261 .TP 0.2i    
       
   262 \(bu
       
   263 none
       
   264 
       
   265 If the \f3sun\&.rmi\&.activation\&.execPolicy\fR property value is \f3none\fR, then the \f3rmid\fR command does not perform any validation of commands to start activation groups\&.
       
   266 .RE     
       
   267 
       
   268 .TP
       
   269 -log \fIdir\fR
       
   270 .br
       
   271 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\fR command was executed\&.
       
   272 .TP
       
   273 -port \fIport\fR
       
   274 .br
       
   275 Specifies the port the registry uses\&. The activation system daemon binds the \f3ActivationSystem\fR, with the name \f3java\&.rmi\&.activation\&.ActivationSystem\fR, in this registry\&. The \f3ActivationSystem\fR on the local machine can be obtained using the following \f3Naming\&.lookup\fR method call:
       
   276 .sp     
       
   277 .nf     
       
   278 \f3import java\&.rmi\&.*; \fP
       
   279 .fi     
       
   280 .nf     
       
   281 \f3    import java\&.rmi\&.activation\&.*;\fP
       
   282 .fi     
       
   283 .nf     
       
   284 \f3\fP
       
   285 .fi     
       
   286 .nf     
       
   287 \f3    ActivationSystem system; system = (ActivationSystem)\fP
       
   288 .fi     
       
   289 .nf     
       
   290 \f3    Naming\&.lookup("//:port/java\&.rmi\&.activation\&.ActivationSystem");\fP
       
   291 .fi     
       
   292 .nf     
       
   293 \f3\fP
       
   294 .fi     
       
   295 .sp     
       
   296 
       
   297 .TP
       
   298 -stop
       
   299 .br
       
   300 Stops the current invocation of the \f3rmid\fR command for a port specified by the \f3-port\fR option\&. If no port is specified, then this option stops the \f3rmid\fR invocation running on port 1098\&.
       
   301 .SH ENVIRONMENT\ VARIABLES    
       
   302 .TP     
       
   303 CLASSPATH
       
   304 Used to provide the system a path to user-defined classes\&. Directories are separated by colons, for example: \f3\&.:/usr/local/java/classes\fR\&.
       
   305 .SH SEE\ ALSO    
       
   306 .TP 0.2i    
       
   307 \(bu
       
   308 java(1)
       
   309 .TP 0.2i    
       
   310 \(bu
       
   311 Setting the Class Path
    80 .RE
   312 .RE
    81 
   313 .br
    82 .LP
   314 'pl 8.5i
    83 .LP
   315 'bp
    84 To specify an alternate port for the registry, you must specify the \f2\-port\fP option when starting up \f2rmid\fP. For example,
       
    85 .LP
       
    86 .nf
       
    87 \f3
       
    88 .fl
       
    89     rmid \-J\-Djava.security.policy=rmid.policy \-port 1099
       
    90 .fl
       
    91 \fP
       
    92 .fi
       
    93 
       
    94 .LP
       
    95 .LP
       
    96 starts the activation system daemon and a registry on the registry's default port, 1099.
       
    97 .LP
       
    98 .SS 
       
    99 Starting rmid from inetd/xinetd
       
   100 .LP
       
   101 .LP
       
   102 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.
       
   103 .LP
       
   104 .LP
       
   105 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.
       
   106 .LP
       
   107 .LP
       
   108 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:
       
   109 .LP
       
   110 .RS 3
       
   111 .TP 2
       
   112 o
       
   113 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. 
       
   114 .TP 2
       
   115 o
       
   116 The \f2\-port\fP option is disallowed. If this option is specified, \f2rmid\fP will exit with an error message. 
       
   117 .TP 2
       
   118 o
       
   119 The \f2\-log\fP option is required. If this option is not specified, \f2rmid\fP will exit with an error message. 
       
   120 .RE
       
   121 
       
   122 .LP
       
   123 .LP
       
   124 See the man pages for \f2inetd\fP (Solaris) or \f2xinetd\fP (Linux) for details on how to configure services to be started on demand.
       
   125 .LP
       
   126 .SH "OPTIONS"
       
   127 .LP
       
   128 .RS 3
       
   129 .TP 3
       
   130 \-C<someCommandLineOption> 
       
   131 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: 
       
   132 .nf
       
   133 \f3
       
   134 .fl
       
   135     rmid \-C\-Dsome.property=value
       
   136 .fl
       
   137 \fP
       
   138 .fi
       
   139 This ability to pass command\-line arguments to child processes can be useful for debugging. For example, the following command: 
       
   140 .nf
       
   141 \f3
       
   142 .fl
       
   143     rmid \-C\-Djava.rmi.server.logCalls=true
       
   144 .fl
       
   145 \fP
       
   146 .fi
       
   147 will enable server\-call logging in all child VMs. 
       
   148 .LP
       
   149 .TP 3
       
   150 \-J<someCommandLineOption> 
       
   151 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: 
       
   152 .nf
       
   153 \f3
       
   154 .fl
       
   155     rmid \-J\-Djava.security.policy=rmid.policy
       
   156 .fl
       
   157 \fP
       
   158 .fi
       
   159 .TP 3
       
   160 \-J\-Dsun.rmi.activation.execPolicy=<policy> 
       
   161 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: 
       
   162 .RS 3
       
   163 .TP 2
       
   164 o
       
   165 \f3default (or if this property is \fP\f4unspecified\fP\f3)\fP 
       
   166 .LP
       
   167 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. 
       
   168 .LP
       
   169 \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: 
       
   170 .nf
       
   171 \f3
       
   172 .fl
       
   173     \-D\fP\f4<property>\fP\f3=\fP\f4<value>\fP\f3
       
   174 .fl
       
   175 \fP
       
   176 .fi
       
   177 .LP
       
   178 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. 
       
   179 .LP
       
   180 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). 
       
   181 .RS 3
       
   182 .TP 3
       
   183 ExecPermission 
       
   184 The \f2ExecPermission\fP class represents permission for \f2rmid\fP to execute a specific \f2command\fP to launch an activation group. 
       
   185 .LP
       
   186 \f3Syntax\fP
       
   187 .br
       
   188 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. 
       
   189 .LP
       
   190 \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.  
       
   191 .TP 3
       
   192 ExecOptionPermission 
       
   193 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. 
       
   194 .LP
       
   195 \f3Syntax\fP
       
   196 .br
       
   197 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 "=". 
       
   198 .LP
       
   199 For example: "*" or "\-Dfoo.*" or "\-Da.b.c=*" is valid, "*foo" or "\-Da*b" or "ab*" is not.  
       
   200 .TP 3
       
   201 Policy file for rmid 
       
   202 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. 
       
   203 .LP
       
   204 An example policy file that grants various execute permissions to \f2rmid\fP is: 
       
   205 .nf
       
   206 \f3
       
   207 .fl
       
   208 grant {
       
   209 .fl
       
   210     permission com.sun.rmi.rmid.ExecPermission
       
   211 .fl
       
   212         "/files/apps/java/jdk1.7.0/solaris/bin/java";
       
   213 .fl
       
   214 
       
   215 .fl
       
   216     permission com.sun.rmi.rmid.ExecPermission
       
   217 .fl
       
   218         "/files/apps/rmidcmds/*";
       
   219 .fl
       
   220 
       
   221 .fl
       
   222     permission com.sun.rmi.rmid.ExecOptionPermission
       
   223 .fl
       
   224         "\-Djava.security.policy=/files/policies/group.policy";
       
   225 .fl
       
   226 
       
   227 .fl
       
   228     permission com.sun.rmi.rmid.ExecOptionPermission
       
   229 .fl
       
   230         "\-Djava.security.debug=*";
       
   231 .fl
       
   232 
       
   233 .fl
       
   234     permission com.sun.rmi.rmid.ExecOptionPermission
       
   235 .fl
       
   236         "\-Dsun.rmi.*";
       
   237 .fl
       
   238 };
       
   239 .fl
       
   240 \fP
       
   241 .fi
       
   242 The 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. 
       
   243 .LP
       
   244 The 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. 
       
   245 .LP
       
   246 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: 
       
   247 .LP
       
   248 \f2rmid \-J\-Djava.security.policy=rmid.policy\fP  
       
   249 .RE
       
   250 .TP 2
       
   251 o
       
   252 \f4<policyClassName>\fP 
       
   253 .LP
       
   254 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. 
       
   255 .LP
       
   256 The \f2policyClassName\fP specifies a public class with a public, no\-argument constructor and an implementation of the following \f2checkExecCommand\fP method: 
       
   257 .nf
       
   258 \f3
       
   259 .fl
       
   260     public void checkExecCommand(ActivationGroupDesc desc,
       
   261 .fl
       
   262                                  String[] command)
       
   263 .fl
       
   264         throws SecurityException;
       
   265 .fl
       
   266 \fP
       
   267 .fi
       
   268 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. 
       
   269 .TP 2
       
   270 o
       
   271 \f3none\fP 
       
   272 .LP
       
   273 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.  
       
   274 .RE
       
   275 .LP
       
   276 .TP 3
       
   277 \-log dir 
       
   278 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. 
       
   279 .LP
       
   280 .TP 3
       
   281 \-port port 
       
   282 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: 
       
   283 .nf
       
   284 \f3
       
   285 .fl
       
   286     import java.rmi.*; 
       
   287 .fl
       
   288     import java.rmi.activation.*;
       
   289 .fl
       
   290 
       
   291 .fl
       
   292     ActivationSystem system; system = (ActivationSystem)
       
   293 .fl
       
   294     Naming.lookup("//:\fP\f4port\fP/java.rmi.activation.ActivationSystem");
       
   295 .fl
       
   296 .fi
       
   297 .TP 3
       
   298 \-stop 
       
   299 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. 
       
   300 .RE
       
   301 
       
   302 .LP
       
   303 .SH "ENVIRONMENT VARIABLES"
       
   304 .LP
       
   305 .RS 3
       
   306 .TP 3
       
   307 CLASSPATH 
       
   308 Used to provide the system a path to user\-defined classes. Directories are separated by colons. For example: 
       
   309 .nf
       
   310 \f3
       
   311 .fl
       
   312     .:/usr/local/java/classes
       
   313 .fl
       
   314 \fP
       
   315 .fi
       
   316 .RE
       
   317 
       
   318 .LP
       
   319 .SH "SEE ALSO"
       
   320 .LP
       
   321 .LP
       
   322 rmic(1), 
       
   323 .na
       
   324 \f2CLASSPATH\fP @
       
   325 .fi
       
   326 http://download.oracle.com/javase/7/docs/technotes/tools/index.html#classpath, java(1)
       
   327 .LP
       
   328