In order to obtain the process identifier required to attach to the exec'd JVM, the external process may create a pid file, containing the process identifier of the process. If this is the case, then configuring the deployment to declare the path of the produced pid file can be done.
If the exec'd process does not create a pid file, SIGAR is used to traverse the process tree to identify the parent process that exec'd the child JVM. If the parent process can be identified (see {@link org.rioproject.impl.system.measurable.SigarHelper#matchChild(int,String[])} theServiceExecutor will attach to the JVM, and monitor CPU and Memory utilization. SIGAR is also used to monitor the real memory used by the exec'd JVM.
This class also provides configuration support for the following entries:
Type: | String |
Default: | exec-template.sh |
Description: | The template to use for generating a script to exec a command. The script template must be loadable as a resource, and must provide the following token that get replaced by runtime values: ${command} The command to execute. This token eirs placed by the command to execute. ${pidFile} Rio creates a file that stores the pid of the executed command. This token is replaced by the name of the pid file to create ${commandLine} This token is replaced by the actual command line that is created to 'exec' the command above. Inoput arguments, standard error and output are also part of the created command line |
Type: | int |
Default: | 60 |
Description: | The amount of time to wait for an exec'd service to create a pid file. The value is in seconds, where 60 seconds is the default. The minimum value for this property is 5 seconds, the maximum allowed 5 minutes. This value represents the maximum amount of time to wait. If the pid file is created prior to the timeout value, the utility proceeds immediately. |
|
|