Dashboard > PXE > Configuring Commandline Launchers > View

Page Operations


Navigation


PXE Log In   View a printable version of the current page.
Configuring Commandline Launchers
Added by Paul Brown, last edited by Paul Brown on Apr 03, 2005

The commandline tools for PXE all use the same basic launcher scripts to load classes and launch the command. (All of the .sh and .bat files are identical.) A configuration file specifies the initial classpath, the class containing the main method, and other parameters. (foo.cfg configures the command foo.sh and foo.bat)

Launcher Implementation

The launcher implementation is in the fivesight.bootstrap package, which is part of the utils module. The implementation works by overriding the system classloader

Classpath and System Properties for Commandline Tools

The Commandline Tools included with PXE are packaged in two flavors, .sh for use on UNIX (and variants) and .bat for use on Windows systems. In either case, the JAVA_HOME environment variable is expected to be set to the location of a suitable JDK. (See System Requirements for more information.)

Each commandline tool has an associated .cfg file that controls its behavior. (The foo.cfg file controls the foo.sh and foo.bat commands.) Each .cfg file is a Java properties file with the following structure:

  • The com.fs.utils.bootstrap.Main.mainClass property is the (real) main class to launch.
  • The com.fs.utils.bootstrap.Main.basedir property is the directory from which the library paths are based, relative to the location of the command.
  • The com.fs.utils.bootstrap.Main.libs property configures the classpath for the launcher. The list can contain directory names (relative to the base directory) or paths of individual JAR or ZIP files. If /* is appended to a directory name, all of the JAR and ZIP files in that directory are added to the classpath. Without a /*, the directory itself is on the classpath. The various entries are treated in order of appearance.
  • The com.fs.utils.bootstrap.system property is a ;-separated or ,-separated list of system properties and values to set.
Be Sure to Escape = in System Property Settings
The = between a property name and value in the com.fs.utils.bootstrap.system property should be escaped with a \.

For example, the .cfg file for the version Command is:

com.fs.utils.bootstrap.Main.mainClass=com.fs.utils.license.Version
com.fs.utils.bootstrap.Main.basedir=../
com.fs.utils.bootstrap.Main.libs=pxe-lib/*,lib/*,lib

Logging and Output for Commandline Tools

The commandline tools are set up to use a consistent set of configuration options for logging.

Commandline tools all obey the following rules of thumb:

  • Output from a tool is sent to standard output. For example, an error message produced by a compiler or validator is expected output and will be output to standard output.
  • Informational output is sent to standard error. For example, an attempt to compile a missing or unreadable would result in output to standard error. Logging-oriented information is also set to standard error.
  • No other output is generated except in the case of the standalone PXE kernel (pxe).

In all cases, the -q ("quiet"), -v ("verbose"), and -vv ("very verbose") flags control the amount of output generated on the console.

Independent of any commandline flags, the PXE kernel logs to the file PXE_HOME/logs/kernel.log according to the configuration in PXE_HOME/etc/log4j.properties.

Debugging Commandline Tools

The launchers all support a --jdb option that will configure the launched JVM for remote debugging on port 5005. The exact configuration can be altered by editing the launcher script.



Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 1.4.1 Build:#212 Jun 02, 2005) - Bug/feature request - Contact Administrators