HDS ViewStation System Administrator's Guide

A Hypertext Document


HDSperx HDS waitforserver Manual Page

This page describes the ViewStation's waitforserver client.

Waitforserver Manual Page
This is the ViewStation's waitforserver local client man page.

NAME
waitforserver - utility to insure X server is accepting connections

SYNOPSIS
waitforserver

DESCRIPTION
waitforserver is a trivial X client which attempts repeatedly to open a connection to the default server, using XOpenDisplay(""). Each attempt will try for the "network timeout" time period, and if the call returns a NULL Display, the XOpenDisplay() function will be called again. Once a successful connection is made to the X Server, the client will exit with a status of 0.

This client is useful in ViewStation Startup Command Files, in order to wait for the X Server to get up and running before attempting to start any clients in the background. This is necessary since the Startup Command File is executed before the X Server is started.

A "chicken and egg" problem exists if you try to include waitforserver directly in a Startup Command File, since if it is started in the foreground it will never succeed in making an X connection, and the ViewStation will appear to "hang". This is because the X Server is not started until after the Startup Command File finishes executing, and the waitforserver client will not terminate (and therefore the Startup Command File will not finish executing) until a successful X connection is made. The solution to this problem is to make another shell script which consists of a single command to invoke the original Startup Command File in the background, and use this new shell script as the Startup Command File.

For example, if you wish to invoke the mwm and hdsdclock clients after the X Server is running, create a file with the following lines:
waitforserver
mwm &
hdsdclock &


You could name this file start_clients, and then create a Startup Command File called startup which consists of the single line:
sh <path>/start_clients &
where <path> is the local filesystem path to the start_clients shell script.

OPTIONS
waitforserver takes no command-line options, but will use the DISPLAY environment variable to specify a display other than the local X Server.

Return to Section Heading Page


Return to the Home Page

If you need more information than is available here, you can reach HDS via email at info@hds.com, or call us at 1.800.HDS.1551 in the USA, or at +610.277.8300 from outside the US. For questions or problems regarding the HDS WWW page, contact webmaster@hds.com.
© 1996 by HDS Network Systems Inc.