rmid(1)
π rmid(1) β Remote Method Invocation (RMI) Tools π
okay bestie, gather round, because this is the manual page for rmid and she is lowkey a whole queen π
β¨ NAME β¨
rmid β starts the activation system daemon, which is the thing that lets objects get registered and activated inside a Java Virtual Machine (JVM). yes, that's the whole vibe. she's a daemon starter. main character energy fr fr π
β¨ SYNOPSIS β¨
rmid [options]
optionsβ the command-line options, bestie. go look at Options for the deets.
β¨ DESCRIPTION β¨
so basically, the rmid command starts the activation system daemon. and here's the thing β that daemon has to be running first before activatable objects can be either registered with the activation system or activated in a JVM. no daemon, no activation, no nothing. it's giving "you can't sit with us" π«Ά
if you wanna know how to actually write programs that use activatable objects, there's a whole Using Activation tutorial waiting for you at:
http://docs.oracle.com/javase/8/docs/technotes/guides/rmi/activation/overview.html
to start the daemon, you execute the rmid command and specify a security policy file, like this:
rmid -J-Djava.security.policy=rmid.policy
now, when you run Oracle's implementation of the rmid command, by default you must specify a security policy file. why? 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. and when we say "specifically", we mean it:
- the command and options specified by the
CommandEnvironment, and - any properties passed to an
ActivationGroupDescconstructor
...must now be explicitly allowed in the security policy file for the rmid command. no cap. π
the value of the sun.rmi.activation.execPolicy property is the thing that dictates the policy the rmid command uses to figure out whether or not the info in an ActivationGroupDesc can be used to start a JVM for an activation group. want more? go read the description of the -J-Dsun.rmi.activation.execPolicy=policy option. iykyk π
executing the rmid command starts the Activator and an internal registry on the default port 1098, and binds an ActivationSystem to the name java.rmi.activation.ActivationSystem in this internal registry. iconic behaviour, honestly.
if you wanna specify an alternate port for the registry, you have to specify the -port option when you execute the rmid command. for example, this next one 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 πΈ
okay so there's an alternative to starting rmid straight from the command line β you can configure inetd (Oracle Solaris) or xinetd (Linux) to start rmid on demand. lazy girl genius energy, we love to see it β¨
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 it's not an instance of java.nio.channels.ServerSocketChannel, then RMID assumes that it was not started by inetd/xinetd, and it starts as previously described. moving on, nothing to see here π
but 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 exports. and which remote objects are those? bestie, it's two:
- the registry in which the
java.rmi.activation.ActivationSystemis bound, and - the
java.rmi.activation.Activatorremote object.
in this mode, RMID behaves the same as when it's started from the command line β except in the following cases, so pay attention π
- output printed to
System.erris redirected to a file. this file lives in the directory specified by thejava.io.tmpdirsystem property (typically/var/tmpor/tmp) with the prefixrmid-errand the suffixtmp. - the
-portoption is not allowed. if this option is specified, then RMID exits with an error message. periodt. π« - the
-logoption is required. if this option is not specified, then RMID exits with an error message.
lowkey important: those two are exits with an error message. RMID is not playing games with you, she will simply leave. π
go see the man pages for inetd (Oracle Solaris) or xinetd (Linux) for the details on how to configure services to be started on demand. π¦
β¨ OPTIONS β¨
okay bestie, here's the whole menu of flags. every single one. no skipping, we're thorough in this house π
-Coptionβ says "hey, pass this option as a command-line argument to every child process (aka activation group) of thermidcommand when that process gets created." For example, you could yeet a property into every virtual machine spawned by the activation system daemon:
rmid -C-Dsome.property=value
The ability to pass command-line arguments to child processes can be genuinely useful for debugging. For example, the following command enables server-call logging in all child JVMs:
rmid -C-Djava.rmi.server.logCalls=true
-Joptionβ says "pass this option to the Java interpreter that's running RMID." For example, to specify that thermidcommand uses a policy file namedrmid.policy, the-Joption can be used to define thejava.security.policyproperty on thermidcommand line, like:
rmid -J-Djava.security.policy-rmid.policy
-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. heads up bestie: this option exists only in Oracle's implementation of the Java RMI activation daemon. If this property isn't specified on the command line, then the result is the same as though-J-Dsun.rmi.activation.execPolicy=defaultwere specified. The possible values of policy aredefault, policyClassName, ornone. Obsessed with options, honestly π
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 implementation can be used with the default execution policy. iykyk
The rmid command starts a JVM for an activation group with the information in the group's registered activation group descriptor, an ActivationGroupDesc. The group descriptor specifies an optional ActivationGroupDesc.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 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 defined as: -D<property>=<value>. The com.sun.rmi.rmid.ExecPermission permission grants the rmid command permission to execute a command that is specified in the group descriptor's CommandEnvironment to start an activation group. The com.sun.rmi.rmid.ExecOptionPermission permission enables the rmid command to use command-line options, specified as properties 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 commands and options, the permissions ExecPermission and ExecOptionPermission must be granted to all code sources. π«Ά
ExecPermission
The ExecPermission class represents permission for the rmid command to execute a specific command to start an activation group.
Syntax: The name of an ExecPermission is the path name of a command to grant the rmid 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, File.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 <<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 ExecOptionPermission class represents permission for the rmid command to use a specific command-line option when starting an activation group. The name of an ExecOptionPermission 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: * or -Dmydir.* or -Da.b.c=* is valid, but *mydir or -Da*b or ab* is not. noted, bestie π
Policy file for rmid
When you grant the rmid command permission to execute various commands and options, the permissions ExecPermission and ExecOptionPermission must be granted to all code sources (universally). It is safe to grant these permissions universally because only the rmid command checks these permissions.
An example policy file that grants various execute permissions to the rmid command is:
grant {
permission com.sun.rmi.rmid.ExecPermission
"/files/apps/java/jdk1.7.0/solaris/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.*";
};
The first permission granted allows the rmid command to execute the 1.7.0 release of the java command, specified by its explicit path name. By default, the version of the java command found in java.home is used (the same one that the rmid command uses), and does not need to be specified in the policy file. The second permission allows the rmid command to execute any command in the directory /files/apps/rmidcmds.
The third permission granted, an ExecOptionPermission, allows the rmid command to start an activation group that defines the security policy file to be /files/policies/group.policy. The next permission allows the java.security.debug property to be used by an activation group. The last permission allows any property in the sun.rmi property name hierarchy to be used by activation groups.
To start the rmid command with a policy file, the java.security.policy property needs to be specified on the rmid command line, for example:
rmid -J-Djava.security.policy=rmid.policy
<policyClassName>
If the default behavior is not flexible enough, then an administrator 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. main character class energy π
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 activation group descriptor and an array that contains the complete command to start the activation group. If the checkExecCommand throws a SecurityException, then the rmid command does not start the activation group and an ActivationException is thrown to the caller attempting to activate the object. no group for you, bestie π
none
If the sun.rmi.activation.execPolicy property value is none, then the rmid command does not perform any validation of commands to start activation groups. zero vibe check, proceed at your own risk π
-logdir β 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 thermidcommand was executed. π-portport β specifies the port the registry uses. The activation system daemon binds theActivationSystem, with the namejava.rmi.activation.ActivationSystem, in this registry. TheActivationSystemon the local machine can be obtained using the followingNaming.lookupmethod 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 thermidcommand for a port specified by the-portoption. If no port is specified, then this option stops thermidinvocation running on port1098. bye bestie π
πΈ ENVIRONMENT VARIABLES πΈ
CLASSPATHβ used to provide the system a path to user-defined classes. Directories are separated by colons, for example:.:/usr/local/java/classes. colons, not semicolons, we're not Windows π
π¦ SEE ALSO π¦
java(1)- Setting the Class Path
and that's the whole page, bestie!! this icon of a manpage is from JDK 8, dated 21 November 2013 β old but still absolutely serving πβ¨ππ«Ά
π¦ where this page comes from
- arch rolling: jdk11-openjdk 11.0.32.1.u1-1 Β· LicenseRef-Java
- arch rolling: jre11-openjdk 11.0.32.1.u1-1 Β· LicenseRef-Java
- arch rolling: jre11-openjdk-headless 11.0.32.1.u1-1 Β· LicenseRef-Java
- Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms