Netra j 2.0 Administrator's Guide

Advanced Configuration Options

You can configure GO-Joe to provide a varitey of functions. This flexibility can be complex, so it is not generally recommended for every user. GO-Joe provides several diagnostic tools and outputs to help diagnose problems that may arise due to misconfiguration and other difficulties. See Appendix D, Troubleshooting for problem-solving tips.

Token

The GO-Joe applet accepts a token parameter in its HTML file. If this parameter is present, the applet transmits it to the go-login program along with the username and password. The go-login program will create an environment variable containing the value $GG_TOKEN which is available for other startup scripts to process.

The format of the $GG_TOKEN variable is as follows:


[session=<openwin[boxv  ]cde>;] [ wm=<window_manager>; [boxv  ] nowm; ] <token>

If present, the session= parameter can be used to specify whether the session will be an OpenWindows style session or a CDE style session. Tokens under the CDE session type are not supported at this time.

Alternate window managers can be specified by prefixing the token proper with wm=/path/to/window/manager;. For security, you must specify an absolute path, and no spaces are allowed (and therefore, no arguments to the window manager). You can start a session without a window manager by prefixing the token proper with nowm;. The semicolon is necessary in both cases to delimit the window manager specification from the token value. Both wm=<window_manager>; and nowm; are optional and need not be specified if the default window manager is desired.

The token value can contain any alphanumeric character, as well as the plus (+), minus (-), and underscore (_) characters. The character set of supported characters is [A-Za-z0-9+-_]. Other symbols are not recommended and are not supported.

In the standard OpenWindows distribution, the openwin script checks for the existence of a ~/.xinitrc file in the user's home directory. If this file exists, it is run by the Xinit program (which also starts the Xsun server). If this file does not exist, the system wide $OPENWINHOME/lib/Xinitrc file is run. The Xinitrc file checks for ~/.openwin-init and will run it to start the sessions initial clients if it is present. If it is not present, the Xinitrc file will run the systemwide $OPENWINHOME/lib/openwin-init file.

When the GlobalHost loadable ddx module is installed, these files are modified to support GO-Joe's token facility. In this installation, the openwin script no longer checks for the existence of ~/.xinitrc, but instead always runs the systemwide $OPENWINHOME/lib/Xinitrc file. This file has been modified to check for the token environment variable ($GG_LOGIN) set by go-login. If $GG_TOKEN is set, the systemwide Xinitrc file checks for a ~/.xgotokenrc file in the user's home directory. If this file exists, it is run, otherwise, the systemwide $OPENWINHOME/lib/Xgotokenrc file is run. These files parse the $GG_TOKEN variable to determine what window manager will be run (if any). Then, they call ~/.xgotoken-init (if it exists) or $OPENWINHOME/lib/xgotoken-init, which parses the $GG_TOKEN variable to determine what clients will be start up. If the token variable does not match any of the available tokens, control is passed to the standard ~/.openwin-init or $OPENWINHOME/lib/openwin-init.

This structure enables you to create system-wide token processing routines by modifying $OPENWINHOME/lib/xgotoken-init, while enabling users to override the settings in the ~/.xgotoken-init file. In addition, care has been taken to ensure that if the $GG_TOKEN variable is not set, the session startup will be the same as a standard OpenWindows installation.

Structure of xgotoken-init

The xgotoken-init is based on the standard openwin-init file, with the addition of the following section:


case "$GG_TOKEN" in
    xterm)
	if [ "$OW_WINDOW_MANAGER" = ':' ]; then
	   toolwait=
	else
	   toolwait=toolwait
	fi
	$toolwait $OPENWINHOME/bin/xterm
        exit
	;;
    *)
	echo warning: /usr/openwin/lib/xgotoken-init: \'$GG_TOKEN\': case not found.
	echo using defaults...
	;;
esac

This section parses the $GG_TOKEN (with any prefixed wm= or nowm flags removed) and starts the appropriate clients. In this example, only one token, xterm , is defined. Any other token will return an error and use the default OpenWindows startup.

Note the handling of the $toolwait variable. In Xgotokenrc, if nowm is specified, it sets the $OW_WINDOW_MANAGER variable (in conformance to the standard OpenWindows method of specifying an alternate window manager) to the colon. This results in no window manager being executed when the shell interprets the colon as an empty command.

Modify the $toolwait variable, if there is a window manager running, the toolwait program starts xterm (which will run in the background). When no window manager is running, the last client started by xgotoken-init must not run in the background, or the GlobalInit program will think that the session is over and will shut down the X server. Conditionally running toolwait solves this problem.