AIX/HP-UX Interoperability Guide (continued)
[Last Chapter: 13. Mail]
AIX's version of the X Window system is called AIXwindows, a separately purchased product that includes the X Window System and Motif. It also includes a graphical user interface (GUI) called the AIXwindows Desktop. With AIX 3.2.5 you can get either AIXwindows Environment/6000 Version 1.2.4, which is based on X11R4, or Version 1.2.5, which provides support for X11R5 and binary compatibility for X11R4. The material in this chapter is based on the latter.
AIX puts all of its X Window files in a single directory, /usr/lpp/X11, but has links to maintain compatibility with traditional X files and directories. The major links are:
/usr/bin/X11 -> /usr/lpp/X11/bin /usr/lib/X11 -> /usr/lpp/X11/lib/X11 /usr/include/X11 -> /usr/lpp/X11/include/X11 /usr/include/Xm -> /usr/lpp/X11/include/Xm
The following standard X commands are found in /usr/lpp/X11/bin:
X bdftopcf fs mkfontdir resize startx xauth xclock xdm xhost xinit xmodmap xpr xrdb xrdb xsetroot xterm xwd
The command mwm is a link to /usr/lpp/X11/Motif1.1.4/bin/mwm.
The following commands in /usr/lpp/X11/bin are actually links to files in the /usr/lpp/X11/Xamples directory:
aixwm appres atobm bitmap bmtoa demodr demomon editres fsinfo fslsfonts fstobdf listres oclock pcfsnfdir pcftobdf showfont showrgb twm viewres xbiff xcalc xclipboard xconsole xcrtca xditview xdpr xdpyinfo xedit xfd xfontsel xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xman xmh xprop xrefresh xsccd xscope xset xstdcmap xwininfo xwud
The /usr/lpp/X11/Xamples directory contains binaries compiled by IBM but are not officially supported. You can build new versions of these binaries as well as other utilities and demos, such as xev, by running the imake and make utilities. Complete instructions on doing so are found in /usr/lpp/X11/Xamples/README.
The location of the xinitrc and xserverrc files, as well as xmodmap key mappings are found in /usr/lpp/X11/defaults. The sample Xdefaults file is /usr/lpp/X11/defaults/Xdefaults.tmpl.
The default configuration of AIX has an ASCII-type of display, called an hft, as the login terminal. You can start the X server at the shell prompt on an hft by typing xinit or startx. The older style of xinit was a script, but with X11R5 it is an executable that initializes the X server and starts a client, which by default is an aixterm. xinit looks for a startup file in the following order:
startx is a script that sets the DISPLAY variable, starts the X server, and then starts clients. startx looks for a startup file in the following order:
If no startup file is found, startx starts the window manager specified by the command line or indicated by the appropriate configuration file, such as .mwmrc. If no such file exists or no window manager is specified on the command line, startx starts mwm by default.
startx reads the resource file specified in the command line or, if not supplied, the resources from one of the following: .Xdefaults, .xdefaults, .Xresources, or .xresources.
You can stop the X server by selecting End Session from the Root Menu or by pressing the Ctrl+Alt+Backspace key combination.
The default terminal emulator on AIX is an aixterm, which emulates a High Function Terminal (or hft, see Chapter 2 for more information on hfts). If you telnet, rlogin, or rsh to a machine that does not have aixterm terminal definitions-and HP-UX machines are among those-you can set the TERM variable to vt100, vt102, vt220, vt320, or xterm to use programs like vi properly, or you can add aixterm terminfo entries by doing the following:
# tic ibm.ti
This procedure will put aixterm terminfo entries into the HP's /usr/lib/terminfo/a directory.
For purposes of interoperability some people like using xterms in order to avoid procedures like the above. However, there are problems in doing so. For example, if you run the smitty command in an xterm instead of an aixterm you will not have all the normal function keys available to you. This is also true for the smit command run remotely via telnet, rlogin, or rsh. Instead, you have to use escape sequences for certain functions. Also, the tn3270 command works best in an aixterm.
If you have X11R4 instead of R5 installed, you will find fonts in /usr/lpp/X11/lib/X11/fonts, and these fonts will be in bdf or snf format. For X11R5 the fonts are in /usr/lib/X11/fonts and are in pcf format. AIXwindows proprietary fonts are in the top level of this directory. If you want access to these fonts from an HP X server you can install them by:
# cd /usr/lib/X11/fonts/misc; mkfontdir
# xset fp rehash
Note: This works only if the fonts are in pcf format. Use utilities like snftobdf and bdftopcf to get older formats into pcf, then do the above.
AIX's generic font server configuration file is /usr/lpp/X11/lib/X11/fs/config. If you cd to the linked directory /usr/lib/X11/fs you will find it as well. This file is simple and similar to those found on other platforms except that it stipulates port 7500 instead of 7000. Any free port will do, but just remember the correct number when you run the xset command on the font client.
To start the font server type:
# fs -config /usr/lpp/X11/lib/X11/fs/config &
To verify the font server type (assuming you're using the KornShell):
# export FONTSERVER=server_name:7500; fsinfo
or
# fsinfo -server server_name:7500
To list the font server fonts (assuming you're using the KornShell):
# export FONTSERVER=server_name:7500; fslsfonts
To get the font client to include the font server fonts in its font path:
# xset +fp tcp/server_name:7500
If you want to use X Display Manager, you can configure the system with the xdmconf utility. This utility, along with all the other xmd-related files are found in /usr/lpp/X11/lib/X11/xdm. For compatibility's sake there is a link from /usr/lib/X11/xdm to this directory.
xdmconf will configure xdm to run at bootup via the SRC if TCP/IP is set up. The SRC command to start xdm is placed at the end of /etc/rc.tcpip. If TCP/IP is not set up for your machine, then xdm will be placed in /etc/inittab for startup by init. To remove xdm configuration, type the following:
# cd /usr/lib/X11/xdm ; ./xdmconf -d
The graphical user interface on AIXwindows is the Desktop. It is started by default in the xinitrc file by the xdt3 command. You can start the Desktop manually by entering this command in the background:
# xdt3 &
There are three forms the AIXwindows Desktop takes: the General Desktop (for newbies), the Power Desktop (for experienced users), and the Admin Desktop (for system administrators). You can go to any of these Desktops by choosing File->Load Desktop in the Desktop menu bar.
Customizing of the Desktop can be accomplished using the Preference Editor, which is available by selecting Options and then Preferences in the Desktop menu bar. More detailed configuration of the Desktop is governed by rule files. These files determine things such as icon appearance, drop behavior, and menu behavior of the Desktop through a mechanism known as the Deskshell programming language. The system-level rule file is /usr/lpp/xdt3/$LANG/xdtsysinfo. The system-level resource file is /usr/lib/X11/app-defaults/Xdesktop3.
The X11 server for HP-UX 9.0x conforms to the X11R5 release of the X Window System from the X Consortium. Hewlett-Packard does not provide or support the entire core MIT distribution. Many of these programs or clients are sample implementations or perform tasks that are accomplished by other clients in Hewlett-Packard's graphical user interface, Visual User Environment (VUE). The primary differences between the core MIT distribution and the Hewlett-Packard X11 release are listed below.
A number of unsupported core MIT clients and miscellaneous utilities are provided in /usr/contrib/bin. In addition, the entire core MIT distribution, compiled for Hewlett-Packard platforms, can be obtained from HP's users group INTERWORKS for a nominal fee. See the release notes for details.
Many other utilities, window managers, games, toolkits, etc. are included as user-contributed software in the MIT distribution, or are available using anonymous ftp on the Internet. See your site administrator for details.
The following standard directories for X binaries and configuration files are provided:
/usr/bin/X11
/usr/lib/X11
The include files for OSF/Motif and X11 are delivered
for HP-UX 9.0x in subdirectories with names specific to their
release:
/usr/include/Motif1.1
/usr/include/Motif1.2
/usr/include/X11R4
/usr/include/X11R5
Shared libraries are also delivered in subdirectories
with names specific to their release:
/usr/lib/Motif1.1
/usr/lib/Motif1.2
/usr/lib/X11R4
/usr/lib/X11R5
The Motif and X libraries ship as shared libraries in HP-UX 9.0x run-time products. HP-UX developer's products include archived libraries for X11R5 and Motif1.2. Applications that use shared libraries incorporate an absolute path to the location of the shared library. The libraries were relocated to subdirectories in /usr/lib so that applications can run on a system that uses either Motif 1.1 or Motif 1.2. The header files appear in release-specific subdirectories so that developers can use release-specific versions of Motif and X. All versions of HP-UX 9.0x contain this directory structure.
Hewlett-Packard has selected a set of the X Consortium clients to support for the HP-UX release 9.0. Some clients that were supported in earlier releases are no longer supported. This is due to current and announced future level of X Consortium support for certain clients, as well as new functionality in R5. In addition, several new clients are not supported
Six clients supported in 8.* releases are not supported for the 9.0 release. Five of these clients are supplied in the 9.0 release, but may not be supplied in the future. These clients are:
bitmap | Replaced by vueicon, the VUE icon editor. If you use the unsupported 9.0 version of bitmap, note that it is substantially different from the 8.* version. See the bitmap man page for complete information. |
xclipboard | This function was a sample implementation. You can use a terminal emulator and an editor to get the same functionality. |
xcutsel | The functionality of xcutsel is now contained in hptermhpterm. |
xfd | You can display font graphics on any application by specifying -fn as a command-line option. You can display font metrics by using xlsfonts. |
xrefresh | The functionality of xrefresh is now handled by the window manager. |
The sixth client, bdftosnf, is not supplied with 9.0 since it has been replaced by bdftopcf.
The new clients not supported are columns, dr_vue, xdpyinfo, xprop, and vuefincalc.
The executable files and man pages for all the unsupported clients are installed in /usr/contrib/bin/X11 and /usr/contrib/man, respectively. In order to use these clients, be sure that your PATH environment variable contains /usr/contrib/bin/X11. Use env to see the current setting of your environment variables. The online man page access utility man looks in /usr/contrib/man by default, so you don't need to modify the MANPATH environment variable.
bdftopcf fs gwind gwindstopxload hpterm mkfontdir mwm resize rgb sb2xwd stconv stlicense stload stmkdirs stmkfont vueicon vuelogin X x11start xauth xclock xcmsdb xhos xinit xinitcolormap xlsfonts xmodmap xpr xrdb xseethru Xserver xset xsetroot xterm xwcreate xwd xwd2sb xwdestroy xwininfo xwud
bitmap columns dr_vue vuefincalc xclipboard xcutsel xdpyinfo xfd xprop xrefresh
On HP systems, the X Window System is normally started via the Visual User Environment (VUE), which uses xdm (X Display Manager) technology rather than xinit to start X. When VUE is not used, the normal method of starting X is via the x11start script which is simply a "wrapper" around xinit providing environment and command line setup appropriate for HP systems.
Specifically, x11start performs the following startup tasks:
x11start encompasses the following components:
Customized client and resource files can be created by copying the default files to $HOME/.x11start and $HOME/.Xdefaults, respectively, and then customizing them. Customized files that exist (with the appropriate permissions) will be used by the x11start components in place of the default files.
Client options pass from the x11start command line to all clients in the .x11start file that have a $@ parameter. The options replace the parameter. This method is most often used to specify a display other than the usual one on which to display the client. You can, however, use the command-line option to specify a non-default parameter, such as a different background color.
The default .x11start file starts the following clients:
Server options are preceded with a double hyphen (--). If the option following the double hyphen begins with a slash (/) or a path and a slash, it starts a server other than the default server. If the option begins with a colon followed by a digit (:#), it specifies the display number (0 is the default display number). Additional options specified after the server or display refer to the specified server or display. See the XSERVER page in the reference section for more information on server options.
# x11start
This starts the default xinit server and executes the client script (either /usr/lib/X11/sys.x11start or $HOME/.x11start) without passing arguments to either.
# x11start -bg black -fn 24x36
This starts the default xinit server and executes the client script, passing it all of the arguments. If the default client script is used, -bg black -fn 24x36 is passed to both mwm and hpterm since both of their default command lines contain $@. If the default client script is used, the actual xinit command executed is xinit /usr/lib/X11/sys.x11start -bg black -fn 24x36.
# x11start -fg white -- :1
This starts the default server on display 1 and executes the client script with the arguments, -fg white. If the customized client script is used, the xinit command line is xinit $HOME/.x11start -fg white -- :1.
# x11start -- Xhp -a2 -t 5
This starts the server, Xhp with the arguments, -a2 -t 5 and then executes the client script without any arguments.
NOTE: Beginning with the next release of HP-UX, x11start and its components (xinit, sys.x11start, and sys.Xdefaults) will not be supported. Instead, startup will be via the program vuelogin, which is directly based on the X Consortium's startup mechanism, xdm. vuelogin is not tied to the VUE environment (and xdm is not) and can be used to start up a non-VUE standard X session without using xinit. The main difference between the xinit startup method and the xdm or vuelogin method is that the former starts the X server, whereas the latter operates with the X server pre-started automatically. This is consistent with X terminals.
After stopping all application programs, stop the window system by holding down the Ctrl and Left Shift keys, and then pressing the Reset (Pause-Break) key. This stops the display server, and with it the window system.
A font server is shipped with Hewlett-Packard's X11R5 distribution but, by default, is not automatically started. To start the font server, execute:
# /usr/bin/X11/fs -daemon
This starts a font server in its default configuration (see below for information on modifying font server configuration). Any X server started on the same system after the font server is started will automatically gain access to the fonts provided by that font server, including the licensed scalable Intellifont and Type 1 fonts in the /usr/lib/X11/fonts/ifo.st and /usr/lib/X11/fonts/type1.st directories.
By default, a font server accepts connections from font clients (such as X servers) at TCP address 7000, and configures itself according to information in the file /usr/lib/X11/fs/config. Both of these defaults can be overridden with command-line options. See the fs(1) man page for more information.
Once you have determined your font server configuration -- one font server per machine, a centralized font server, or whatever -- and determined which machines you wish to use as font hosts, you should configure these hosts to start a server whenever they boot. You can do this by adding the appropriate commands to the /etc/rc startup file. For example, add the following definition to the function definitions at the beginning of the file:
start_fontserver() { if [ -x /usr/bin/X11/fs ] then echo "starting fontserver" /usr/bin/X11/fs -daemon fi }
You also need to add start_fontserver to the appropriate list of startup actions in the "Actions based on system type" section. As defined above, whenever the host boots, a font server starts at the default TCP address of 7000 using the default configuration file /usr/lib/X11/fs/config.
If the font server is to be run on the same machine as the X server and if the font server is started before the X server, the font server does not need to be added to the font path of the X server. However, if the font server is started after the X server is already running, or if a font server is running on a different machine than the X server, then the font server must be added to the font path of the X server as follows:
# xset +fp tcp/:7000
This adds the font server port to the front of the font path list searched by the X server. If you are adding a font server that is not running on the same machine as the X server, the xset command is extended to also specify the font server host:
# xset +fp tcp/host_name:7000
Once the font server is running and has been added to the font path of an X server, the server must rehash its fonts. This is also done with the xset client via:
# xset fp rehash
The hpterm client emulates a Term0 terminal. The syntax of the hpterm client is as follows:
# hpterm [-options] [&]
There are too many options to cover here. Refer to the hpterm man page for all the options available.
Two different flavors of hpterm are available. The one built on X11R4 versions of Xlib, Xt, and Motif 1.1 is delivered by default. The version built on X11R5 versions of Xlib, Xt, and Motif 1.2 is delivered in /usr/bin/X11/hpterm.R5.sh.Z, which is a compressed shar file. To install this version, uncompress and unshar hpterm.R5.sh.Z. For more information on how to choose between the R4-based hpterm and the R5-based hpterm, see README.hpterm in hpterm.R5.sh.Z.
When running block mode applications, it may be necessary for hpterm to identify itself to application programs as some terminal other than "X-hpterm." Most applications understand the terminal id "2392A." Newer applications also understand the terminal id "700/92" while older applications may only understand the terminal id "2622A." To set the terminal identification string, use the -ti command line option, the termId resource, or the TermId class.
To put hpterm terminfo entries on an RS/6000:
# untic hpterm > hpterm.ti
ftp RS_node
ftp> cd /tmp
ftp> put hpterm.ti
ftp> quit
# tic /tmp/hpterm.ti
This will put the appropriate terminfo entries in /usr/share/lib/terminfo/h on the RS/6000.
The HP Visual User Environment (HP VUE) is a graphical user interface that is based on the X Window system. The X Window System can be run alone, or as part of HP VUE.
HP VUE consists of six components, known as "managers":
vuelogin | Validates user login |
vuesession | Starts and later saves the user's session |
vuewm | The user's workspace and window manager |
vuefile | Application launcher, file, and directory browser |
vuestyle | Interactive application resource customizer |
vuehelp | On-line help and man page browser |
vuelogin is the first interface the user sees. It provides services similar to in init, getty, and login on character terminals: prompting for login and password, authenticating the user, and running a user's session. Specifically, vuelogin is responsible for:
A session in the VUE context is defined as the time between logging in and logging out, or the lifetime of the session manager. The session manager provides the ability to save and restore sessions. The following are characteristics of sessions stored and restored by the session manager:
The system-wide HP VUE directories are:
/usr/vue/bin | HP VUEHP VUE executables |
/usr/vue/config | Configuration files for the login, session, and workspace manager |
/usr/vue/types | Built-in actions and file types |
/usr/vue/app-defaults | Application defaults for HP VUEHP VUE clients |
/usr/vue/icons | HP VUEHP VUE system-wide icons |
For each user the .vueprofile file contains environmental settings and takes the place of the standard .profile or .login files. The .vue subdirectory in $HOME contains other configuration files, applications, tools, and palettes.
Remember that VUE and X can be used at different times. A user could need Motif and regular X one day and HP VUE the next. So it is very important to keep these files separate. Notice there is no equivalent to the .Xdefaults file. Instead, the RESOURCE_MANAGER property is used. Resources are loaded into the RESOURCE_MANAGER property by the session manager at the beginning of a session. The session manager stores resources at the end of a session. System-wide resources are stored in /usr/vue/config/sys.resources. Properties can be modified during a session using the style manager, the EditResources action, or the xrdb command.
X11
|
VUE
|
.profile (or .login)
|
.vueprofile
|
.Xdefaults
|
RESOURCE_MANAGER
|
.x11start
|
vuesession
|
.mwmrc
|
vuewmrc
|
X, like TCP/IP, NFS, NIS, DNS, and sendmail, is essentially the same on both AIX and HP-UX. Only the details differ. X has made interoperability among UNIX systems much easier in that clients can run on one platform and display on another. This is even true of clients such as SAM and SMIT, which you may find necessary to access from a box of another ilk.
Using xhost, you can add or delete a remote host's permission to access the local display server. For example, the following command allows the remote host stargate to access your local display.
# xhost +stargate
The default display on which a client is displayed is obtained from the DISPLAY environment variable of the system on which the client starts. It sets the host, display number, and screen number to which the client directs its output. This is typically display 0, screen 0. Most clients have a -display option that lets you set the host, display number, and screen on which the client will display its output. The -display option has the syntax:
-display [host:display.screen]
where:
host is the hostname of a valid system on the network.
display is the number of the display on the system on which you want the output to appear. A display can include more than one screen.
screen is the number of the screen where the output is to appear. The default is 0.
For example, executing the command:
# hpterm -display rs_node:0.1 &
starts an hpterm process on the local system and displays the window on display 0, screen 1 of the rs_node system. The window has the default size, location, and color. Conversely, you can run the following command on an RS/6000:
# aixterm -display hp_node:0 &
If you need the capabilities of these terminal emulators on machines other than the ones they were designed for, this is the way to do it. However, the HP machine will not have the proprietary IBM fonts that will give the aixterm the same appearance it has when run locally on an RS/6000. The same is true for RS/6000s displaying hpterms. This fact does not hinder the functionality of these emulators, but if you prefer for each to look exactly the same whether running locally or remotely on another platform, you must do one of two things:
There are several ways to run programs on a remote host from a command line:
If the client produces output on a display, you must specify the display and screen on which you want the output to appear.
You can use an existing terminal emulator window to log into a remote host. Once the window is acting as a terminal off the remote host, you can run clients there and direct the output to any display. For example, the following commands log into and start xload on remote host rs_node and display the output on local system hp_node.
# rlogin rs_node
# xload -display hp_node:0.0 &
The benefit of using remsh or rsh instead of rlogin is that the local system starts only one process (the client) with a remote shell; with the remote login, the local system starts both the remote login and the client.
The following syntax starts a remote shell on a remote host, redirects remsh input, starts a client, and directs output to the local display.
# remsh remote -n client -display local:display.screen &
where:
remote is the remote host name.
client is the absolute path of the executable client file (remsh and rsh does not allow the PATH variable).
local is the local host name.
For example, the following command runs xload on remote host rs_node and directs output to the display of system hp_node.
# remsh rs_node -n /usr/bin/X11/xload -display hp_node:0.0 &
Going the other way:
# rsh hp_node -n /usr/bin/X11/xload -display rs_node:0.0 &
NOTE: To make these examples run flawlessly requires use of the xhost command and the appropriate .rhosts entries. For more information on executing remote commands without a password check the remsh man page on the HP and the rsh man page on the RS/6000.
Occasionally you might want to connect to a machine of a different platform and perform administrative tasks completely within the environment of the remote machine. If you do, all you need to do is convert your local workstation into an X terminal connected to the remote machine.
To convert an HP workstation into an X terminal running off an RS/6000 called rs_node:
# X -query rs_node
To convert an RS/6000 workstation into an X terminal running off an HP 9000 called hp_node:
# X -query hp_node
Provide feedback to: alan_roberts@hp.com