manpagez: man pages & more
man rmid(1)
Home | html | info | man
rmid(1)                          JDK Commands                          rmid(1)




NAME

       rmid  -  start  the activation system daemon that enables objects to be
       registered and activated in a Java Virtual Machine (JVM)


SYNOPSIS

       rmid [options]

       options
              This represent the command-line options for  the  rmid  command.
              See Options for rmid.


DESCRIPTION

       Deprecation Notice: The rmid tool and the RMI Activation mechanism have
       been deprecated and may be removed from a future version of  the  plat-
       form.   See JEP 385 [https://openjdk.java.net/jeps/385] for further in-
       formation.

       The rmid command starts the activation system daemon.   The  activation
       system  daemon must be started before objects that can be activated are
       either registered with the activation system or activated in a JVM.

       Start the daemon by executing the rmid command and specifying a securi-
       ty policy file, as follows:

              rmid -J-Djava.security.policy=rmid.policy

       When  you  run  Oracle's implementation of the rmid command, by default
       you must specify a security policy file so that the  rmid  command  can
       verify  whether  or  not the information in each ActivationGroupDesc is
       allowed to be used to start a JVM for an activation group.  Specifical-
       ly, the command and options specified by the CommandEnvironment and any
       properties passed to an ActivationGroupDesc constructor must now be ex-
       plicitly allowed in the security policy file for the rmid command.  The
       value of the sun.rmi.activation.execPolicy property dictates the policy
       that  the rmid command uses to determine whether or not the information
       in an ActivationGroupDesc can be used to start a JVM for an  activation
       group.  For more information see the description of the -J-Dsun.rmi.ac-
       tivation.execPolicy=policy option.

       Executing the rmid command starts the Activator and  an  internal  reg-
       istry  on  the  default  port 1098 and binds an ActivationSystem to the
       name java.rmi.activation.ActivationSystem in this internal registry.

       To specify an alternate port for the registry,  you  must  specify  the
       -port  option when you execute the rmid command.  For example, the fol-
       lowing command starts the activation system daemon and  a  registry  on
       the registry's default port, 1099.

              rmid -J-Djava.security.policy=rmid.policy -port 1099


START RMID ON DEMAND (LINUX ONLY)

       An  alternative  to starting rmid from the command line is to configure
       xinetd (Linux) to start rmid on demand.

       When RMID starts, it attempts to obtain an inherited channel (inherited
       from  inetd/xinetd)  by calling the System.inheritedChannel method.  If
       the inherited channel is null or  not  an  instance  of  java.nio.chan-
       nels.ServerSocketChannel,  then  RMID assumes that it wasn't started by
       inetd/xinetd, and it starts as previously described.

       If the inherited channel is a ServerSocketChannel instance,  then  RMID
       uses the java.net.ServerSocket obtained from the ServerSocketChannel as
       the server socket that accepts requests for the remote objects  it  ex-
       ports:  The  registry in which the java.rmi.activation.ActivationSystem
       is bound and the java.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:

       o Output printed to System.err is redirected to a file.  This  file  is
         located in the directory specified by the java.io.tmpdir system prop-
         erty (typically /var/tmp or /tmp) with the prefix  rmid-err  and  the
         suffix tmp.

       o The  -port  option  isn't allowed.  If this option is specified, then
         RMID exits with an error message.

       o The -log option is required.  If this option  isn't  specified,  then
         RMID exits with an error message


OPTIONS FOR RMID

       -Coption
              Specifies  an option that's passed as a command-line argument to
              each child process (activation group) of the rmid  command  when
              that process is created.  For example, you could pass a property
              to each virtual machine spawned by the activation system daemon:

                     rmid -C-Dsome.property=value

              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.

                     rmid -C-Djava.rmi.server.logCalls=true

       -Joption
              Specifies  an  option that's passed to the Java interpreter run-
              ning RMID command.  For example, to specify that the  rmid  com-
              mand  use  a policy file named rmid.policy, the -J option can be
              used to define the java.security.policy  property  on  the  rmid
              command line, for example:

                     rmid -J-Djava.security.policy-rmid.policy

       -J-Dsun.rmi.activation.execPolicy=policy
              Specifies the policy that the RMID command employs to check com-
              mands and command-line options used to start the JVM in which an
              activation  group runs.  This option exists only in Oracle's im-
              plementation of the Java RMI activation daemon.  If this proper-
              ty  isn't  specified on the command line, then the result is the
              same as  though  -J-Dsun.rmi.activation.execPolicy=default  were
              specified.

              The  possible  values of policy can be default, policyClassName,
              or none.

              o default

                The default or unspecified value execPolicy  allows  the  rmid
                command to execute commands with specific command-line options
                only when the rmid command was granted permission  to  execute
                those  commands  and  options in the security policy file that
                the rmid command uses.  Only the default activation group  im-
                plementation can be used with the default execution policy.

                The rmid command starts a JVM for an activation group with the
                information in the group's  registered  activation  group  de-
                scriptor, ActivationGroupDesc.  The group descriptor specifies
                an optional  ActivationGroupDesc.CommandEnvironment  that  in-
                cludes  the  command  to execute to start the activation group
                and any command-line options to be added to the command  line.
                By  default,  the  rmid command uses the java command found in
                java.home.  The  group  descriptor  also  contains  properties
                overrides  that  are  added to the command line as options de-
                fined as: -Dproperty=value.  The  com.sun.rmi.rmid.ExecPermis-
                sion  permission grants the rmid command permission to execute
                a command that's specified in the group  descriptor's  Comman-
                dEnvironment    to    start    an   activation   group.    The
                com.sun.rmi.rmid.ExecOptionPermission permission  enables  the
                rmid command to use command-line options, specified as proper-
                ties overrides in the group descriptor or as  options  in  the
                CommandEnvironment  when  starting the activation group.  When
                granting the rmid command permission to execute  various  com-
                mands  and options, the permissions ExecPermission and ExecOp-
                tionPermission must be granted to all code sources.

                ExecPermission class: Represents permission for the rmid  com-
                mand  to  execute  a  specific  command to start an activation
                group.

                ExecPermission syntax: The name of ExecPermission is the  path
                name of a command to grant the rmid command permission to exe-
                cute.

                A path name that ends in a slash (/) and an asterisk (*) indi-
                cates  that  all  of the files are contained in that directory
                where the slash is the file-separator character,  File.separa-
                torChar.

                A  path name that ends in a slash (/) and a minus sign (-) in-
                dicates that all files and  subdirectories  are  contained  in
                that directory (recursively).

                A  path  name that consists of the special token <<ALL FILES>>
                matches any file.

                A path name that consists of an asterisk  (*)  indicates  that
                all the files are in the current directory.

                A  path  name that consists of a minus sign (-) indicates that
                all the files are in the current directory  and  (recursively)
                all  files and subdirectories are contained in the current di-
                rectory.

                ExecOptionPermission class: Represents permission for the rmid
                command to use a specific command-line option when starting an
                activation group.  The name  of  ExecOptionPermission  is  the
                value of a command-line option.

                ExecOptionPermission  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: * or -Dmydir.* or -Da.b.c=* is valid, but  *mydir
                or -Da*b or ab* isn't valid.

                Policy file for rmid

                When  you grant the rmid command permission to execute various
                commands and options, the permissions ExecPermission and  Exe-
                cOptionPermission must be granted to all code sources (univer-
                sally).  It is safe to grant these permissions universally be-
                cause only the rmid command checks these permissions.

                An example policy file that grants various execute permissions
                to the rmid command is:

                o Linux:

                         grant {
                             permission com.sun.rmi.rmid.ExecPermission
                                 "/files/apps/java/jdk1.7.0/linux/bin/java";

                             permission com.sun.rmi.rmid.ExecPermission
                                 "/files/apps/rmidcmds/*";

                             permission com.sun.rmi.rmid.ExecOptionPermission
                                 "-Djava.security.policy=/files/policies/group.policy";

                             permission com.sun.rmi.rmid.ExecOptionPermission
                                 "-Djava.security.debug=*";

                             permission com.sun.rmi.rmid.ExecOptionPermission
                                 "-Dsun.rmi.*";
                         };

                o Windows:

                         grant {
                             permission com.sun.rmi.rmid.ExecPermission
                                 "c:\\files\\apps\\java\\jdk1.7.0\\win\\bin\\java";

                             permission com.sun.rmi.rmid.ExecPermission
                                 "c:\\files\\apps\\rmidcmds\\*";

                             permission com.sun.rmi.rmid.ExecOptionPermission
                                 "-Djava.security.policy=c:\\files\\policies\\group.policy";

                             permission com.sun.rmi.rmid.ExecOptionPermission
                                 "-Djava.security.debug=*";

                             permission com.sun.rmi.rmid.ExecOptionPermission
                                 "-Dsun.rmi.*";
                         };

                The first permission granted allows the rmid command  to  exe-
                cute  the  1.7.0 release of the java command, specified by its
                explicit path name.  By default, the version of the java  com-
                mand  found  in  java.home is used (the same one that the rmid
                command uses), and doesn't need to be specified in the  policy
                file.   The  second permission allows the rmid command to exe-
                cute any command in either the directory  /files/apps/rmidcmds
                (Linux  and  macOS)  or  the directory c:\files\apps\rmidcmds\
                (Windows).

                The third permission granted, ExecOptionPermission, allows the
                rmid command to start an activation group that defines the se-
                curity policy file to be  either  /files/policies/group.policy
                (Linux) or c:\files\policies\group.policy (Windows).  The next
                permission allows the java.security.debug property to be  used
                by  an activation group.  The last permission allows any prop-
                erty in the sun.rmi property name hierarchy to be used by  ac-
                tivation groups.

                To start the rmid command with a policy file, the java.securi-
                ty.policy property needs to be specified on the  rmid  command
                line, for example:

                rmid -J-Djava.security.policy=rmid.policy.

              o policyClassName

                If  the default behavior isn't flexible enough, then an admin-
                istrator can provide, when starting the rmid command, the name
                of  a class whose checkExecCommand method is executed to check
                commands to be executed by the rmid command.

                The policyClassName specifies a public class  with  a  public,
                no-argument constructor and an implementation of the following
                checkExecCommand method:

                        public void checkExecCommand(ActivationGroupDesc desc, String[] command)
                               throws SecurityException;

                Before starting an activation group, the  rmid  command  calls
                the  policy's checkExecCommand method and passes to it the ac-
                tivation group descriptor and an array that contains the  com-
                plete  command to start the activation group.  If the checkEx-
                ecCommand throws a SecurityException, then  the  rmid  command
                doesn't  start the activation group and an ActivationException
                is thrown to the caller attempting to activate the object.

              o none

                If the sun.rmi.activation.execPolicy property value  is  none,
                then  the  rmid command doesn't perform any validation of com-
                mands to start activation groups.

       -log dir
              Specifies the name of the directory that 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 rmid command was executed.

       -port port
              Specifies  the port that the registry uses.  The activation sys-
              tem daemon binds ActivationSystem, with the name  java.rmi.acti-
              vation.ActivationSystem, in this registry.  The ActivationSystem
              on the local machine can be obtained using  the  following  Nam-
              ing.lookup method call:

                     import java.rmi.*;
                     import java.rmi.activation.*;

                     ActivationSystem system; system = (ActivationSystem)
                     Naming.lookup("//:port/java.rmi.activation.ActivationSystem");

       -stop  Stops  the  current  invocation  of  the rmid command for a port
              specified by the -port option.  If no port  is  specified,  then
              this option stops the rmid invocation running on port 1098.



JDK 15                               2020                              rmid(1)

openjdk 15.0.2 - Generated Thu Feb 25 15:31:17 CST 2021
© manpagez.com 2000-2025
Individual documents may contain additional copyright information.