[Graphics Admin
    Guide] [Index]

X Server

Table of Contents


(home) Synopsis

X :displaynumber [-option] ttyname

(home) Description

"X" is the generic name for the window system server. It is started by the dtlogin(1X) program which is typically run by init(1M). Alternatively it may be started from the xinit(1) program, which is called by x11start. The displaynumber argument is used by clients in their DISPLAY environment variables to indicate which server to contact (machines may have several displays attached). This number can be any number. If no number is specified, 0 is used. This number is also used in determining the names of various startup files. The ttyname argument is passed in by init and isn't used.

The Hewlett-Packard server has support for the following protocols:

TCP/IP
The server listens on port 6000+n, where n is the display number.
Local Socket IPC Mechanism
The file name for the socket is "/usr/spool/sockets/X11/*" where "*" is the display number.
Shared Memory IPC
This is the default connection that the X Library will use to connect to an X server on the same machine if the DISPLAY environment variable is set to "local:*" or ":*" where "*" is the number of the display.
When the server starts up, it takes over the display. If you are running on a workstation whose console is the display, you cannot log into the console while the server is running.

(home) Options

The following options can be given on the command line to the X server.
-a number
Sets pointer acceleration (i.e. the ratio of how much is reported to how much the user actually moved the pointer).
-audit level
Sets the audit trail level. The default level is 1, meaning only connection rejections are reported. Level 2 additionally reports all successful connections and disconnects. Level 0 turns off the audit trail. Audit lines are sent as standard error output.
-auth authorization-file
Specifies a file which contains a collection of authorization records used to authenticate access.
bc
Disables certain kinds of error checking, for bug compatibility with previous releases (e.g., to work around bugs in R2 and R3 xterms and toolkits). Deprecated.
-bs
Disables backing store support on all screens.
-c
Turns off key-click.
c volume
Sets key-click volume (allowable range: 0-100).
-co filename
Sets name of RGB color database.
-core
Causes the server to generate a core dump on fatal errors.
-dpi resolution
Sets the resolution of the screen, in dots per inch. To be used when the server cannot determine the screen size from the hardware.
-f volume
Sets beep (bell) volume (allowable range: 0-100).
-fc cursorFont
Sets default cursor font.
-fn font
Sets the default font.
-fp fontPath
Sets the search path for fonts. This path is a comma-separated list of directories which the server searches for font databases.
-help
Prints a usage message.
-I
Causes all remaining command line arguments to be ignored.
-logo
Turns on the X Window System logo display in the screen-saver. There is currently no way to change this from a client.
nologo
Turns off the X Window System logo display in the screen-saver. There is currently no way to change this from a client.
-p minutes
Sets screen-saver pattern cycle time in minutes.
-pn
Allows X server to run even if one or more communications mechanisms fails to initialize.
-pn
Permits the server to continue running if it fails to establish all of its well-known sockets, but establishes at least one.
-r
Turns off keyboard auto-repeat.
r
Turns on keyboard auto-repeat.
-s minutes
Sets screen-saver timeout time in minutes.
-su
Disables save under support on all screens.
-t number
Sets pointer acceleration threshold in pixels (i.e. after how many pixels pointer acceleration should take effect).
-terminate
Causes the server to terminate at server reset, instead of continuing to run.
-to seconds
Sets default connection timeout in seconds.
-tst
Disables all testing extensions (e.g., XTEST, XTrap, XTestExtension1).
ttyxx
Ignored; for servers started the ancient way (from init).
-terminate
Causes server to terminate when all clients disconnect.
v
Sets video-on screen-saver preference. A window that changes regularly will be used to save the screen.
-v
Sets video-off screen-saver preference. The screen will be blanked to save the screen.
-wm
Forces the default backing-store of all windows to be WhenMapped; a less-expensive way of getting backing-store to apply to all windows.
You can also have the X server connect to xdm(1) or dtlogin(1X) using XDMCP. Although this is not typically useful as it doesn't allow xdm to manage the server process, it can be used to debug XDMCP implementations, and serves as a sample implementation of the server side of XDMCP. The following options control the behavior of XDMCP:
-query host-name
Enable XDMCP and send Query packets to the specified host.
-broadcast
Enable XDMCP and broadcast BroadcastQuery packets to the network. The first responding display manager will be chosen for the session.
-indirect host-name
Enable XDMCP and send IndirectQuery packets to the specified host.
-port port-num
Use an alternate port number for XDMCP packets. Must be specified before any -query, -broadcast or -indirect options. Default port number is 177.
-class display-class
XDMCP has an additional display qualifier used in resource lookup for display-specific options. This option sets that value, by default it is "MIT-Unspecified" (not a very useful value).
-cookie xdm-auth-bits
When testing XDM-AUTHENTICATION-1, a private key is shared between the server and the manager. This option sets the value of that private data (not that it's very private, being on the command line and all...).
-displayID display-id
Yet another XDMCP-specific value, this one allows the display manager to identify each display so that it can locate the shared key.

(home) Running From init

Though X will usually be run by dtlogin from init, it is possible to run X directly from init. For information about running X from dtlogin, see the dtlogin man page.

To run X directly from init, it is necessary to modify /etc/inittab and /etc/gettydefs. Detailed information on these files may be obtained from the inittab(4) and gettydefs(4) man pages.

To run X from init on display 0, with a login xterm running on /dev/ttypf, in init state 3, the following line must be added to /etc/inittab:

X0:3:respawn:env PATH=/bin:/usr/bin/X11:/usr/bin  xinit -L ttyqf -- :0
To run X with a login hpterm, the following should be used instead:
X0:3:respawn:env PATH=/bin:/usr/bin/X11:/usr/bin xinit hpterm =+1+1 -n   login -L ttyqf -- :0
In addition, the following line must be added to /etc/gettydefs (this should be a single line):
Xwindow# B9600 HUPCL PARENB CS7 # B9600 SANE PARENB  CS7  ISTRIP  IXANY TAB3   #X login: #Xwindow
There should not be a getty running against the display whenever X is run from xinit.

(home) Security

The sample server implements a simplistic authorization protocol, MIT-MAGIC-COOKIE-1 which uses data private to authorized clients and the server. This is a rather trivial scheme; if the client passes authorization data which is the same as the server has, it is allowed access. This scheme is inferior to host-based access control mechanisms in environments with unsecure networks as it allows any host to connect, given that it has discovered the private key. But in many environments, this level of security is better than the host-based scheme as it allows access control per-user instead of per-host.

In addition, the server provides support for a DES-based authorization scheme, XDM-AUTHORIZATION-1, which is more secure (given a secure key-distribution mechanism), but as DES is not generally distributable, the implementation is missing routines to encrypt and decrypt the authorization data. This authorization scheme can be used in conjunction with XDMCP's authentication scheme, XDM-AUTHENTICATION-1 or in isolation.

The authorization data is passed to the server in a private file named with the -auth command line option. Each time the server is about to accept the first connection after a reset (or when the server is starting), it reads this file. If this file contains any authorization records, the local host is not automatically allowed access to the server, and only clients which send one of the authorization records contained in the file in the connection setup information will be allowed access. See the Xau manual page for a description of the binary format of this file. Maintenance of this file, and distribution of its contents to remote sites for use there, is left as an exercise for the reader.

The sample server also uses a host-based access control list for deciding whether or not to accept connections from clients on a particular machine. This list initially consists of the host on which the server is running as well as any machines listed in the file /etc/Xn.hosts, where n is the display number of the server. Each line of the file should contain an Internet hostname (e.g., expo.lcs.mit.edu). There should be no leading or trailing spaces on any lines. For example:

joesworkstation
corporate.company.com
Users can add or remove hosts from this list and enable or disable access control using the xhost command from the same machine as the server. For example:
$ xhost +janesworkstation
janesworkstation being added to access control list
$ xhost +
all hosts being allowed (access control disabled)
$ xhost -
all hosts being restricted (access control enabled)
$ xhost
access control enabled (only the following hosts are allowed)
joesworkstation
janesworkstation
corporate.company.com

(home) Signals

The X server attaches special meaning to the following signals:
SIGHUP
This signal causes the server to close all existing connections, free all resources, and restore all defaults. It is sent by the display manager (xdm or dtlogin) whenever the main user's main application exits to force the server to clean up and prepare for the next user.
SIGTERM
This signal causes the server to exit cleanly.
SIGUSR1
This signal is used quite differently from either of the above. When the server starts, it checks to see if it has inherited SIGUSR1 as SIG_IGN instead of the usual SIG_DFL. In this case, the server sends a SIGUSR1 to its parent process after it has set up the various connection schemes. xdm uses this feature to recognize when connecting to the server is possible.

(home) Fonts

Fonts are usually stored as individual files in directories. The list of directories in which the server looks when trying to open a font is controlled by the font path. Although most sites will choose to have the server start up with the appropriate font path (using the -fp option mentioned above), it can be overridden using the xset program.

Font databases are created by running the mkfontdir or stmkdirs program in the directory containing the compiled versions of the fonts (mkfontdir) or font outlines (stmkdirs.) Whenever fonts are added to a directory, mkfontdir or stmkdirs should be rerun so that the server can find the new fonts. If mkfontdir or stmkdirs is not run, the server will not be able to find any of the new fonts in the directory.

In addition, the X server supports font servers. A font server is a networked program that supplies fonts to X servers and other capable programs. In order to communicate with a font server, the font servers address must be supplied as part of the X server's font path. A font server's address is specified as:

transport/hostname:port-number

where transport is always "tcp", hostname is the hostname of the machine being connected to (no hostname means a local connection) and port-number is the tcp address that the font server is listening at (typically 7000.)

(home) Diagnostics

Too numerous to list them all. If run from init(1M), errors are logged in the file /usr/adm/X*msgs.

(home) Files

/etc/inittab
Script for the init process
/etc/gettydefs
Speed and terminal settings used by getty
/etc/X*.hosts
Initial access control list
/usr/lib/X11/fonts
Top level font directory
/usr/lib/X11/rgb.txt
Color database
/usr/lib/X11/rgb.pag
Color database
/usr/lib/X11/rgb.dir
Color database
/usr/spool/sockets/X11/*
IPC mechanism socket
/usr/adm/X*msgs
Error log file
/usr/lib/X11/X*devices
Input devices used by the server. This file contains many example configurations.
/usr/lib/X11/X*screens
Screens used by the server. This file contains many example configurations.
/usr/lib/X11/X*pointerkeys
Keyboard pointer device file. This file contains many example configurations.
/usr/lib/X11/XHPkeymaps
Key device database used by the X server.

(home) Notes

The option syntax is inconsistent with itself and xset(1). The acceleration option should take a numerator and a denominator like the protocol. The color database is missing a large number of colors. However, there doesn't seem to be a better one available that can generate RGB values.

(home) Copyright

Copyright 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992 Massachusetts Institute of Technology.
Copyright 1992 Hewlett Packard Company. See X(1) for a full statement of rights and permissions.

(home) Origin

MIT Distribution.

(home) See Also

dtlogin(1X), bdftopcf(1), fs(1), getty(1M), gettydefs(4), gwindstop(1), hpterm(1), init(1M), inittab(4), mkfontdir(1), rgb(1), stmkdirs(1), x11start(1), xclock(1), xfd(1), xhost(1), xinit(1), xinitcolormap(1), xload(1), xmodmap(1), xrefresh(1), xseethru(1), xset(1), xsetroot(1), xterm(1), xwcreate(1), xwd(1), xwdestroy(1), xwininfo(1), xwud(1).