E.4. Login Script Timeouts

SGD uses several timeouts when starting applications. The following timeouts are available:

Note

None of the timeouts, apart from the Execution Protocol Engine timeout, apply when starting a Microsoft Windows application.

E.4.1. Expect Timeouts

The Expect timeouts are defined in the vars.exp login script. The following table lists the available Expect timeouts and their default values.

Timeout

Default Value

timeouts(hostprobe)

30 seconds

timeouts(prelogin)

40 seconds

timeouts(loggedin)

20 seconds

If an Expect timeout expires, the script attempts to guess the prompt, and then continues to start the application.

timeouts(hostprobe)

The timeouts(hostprobe) timeout is called by the unix.exp login script. This is the time to wait for a response from the ttahostprobe binary. The ttahostprobe binary is used to check whether an application server is available.

The ttahostprobe binary outputs its response to standard output (stdout), and returns y for success or n for failure.

timeouts(prelogin)

The time allowed for each Expect command to match a required string during the login phase.

For example, after the connection is made to the application server, the script has 40 seconds by default to match the login prompt before it times out. Every successful match resets the timer. During a login, the timeout is usually reset for the login prompt, the password prompt, and the shell prompt.

Increasing this timeout increases the time allowed for each phase of the login. This timeout must be large enough to allow for the longest phase of the login to be completed.

If the timeout expires, the script assumes that it is logged in and has failed to match the shell prompt and sends echo SYNC to the application server to guess the prompt string. If the user is not logged in when the timer fires, the application fails to start. Otherwise, the shell prompt is set to whatever the application server sent immediately after the echo SYNC and the application startup continues.

Note

If you see echo SYNC and the shell prompt ends in the normal way with $, %, #, or >, the timeouts(prelogin) value is too short.

timeouts(loggedin)

The time allowed for each Expect command to match a required string once the user is logged in.

If the timeout expires, the script moves on to the next command. This can cause commands to be sent before the prompt has returned.

The most common occurrence of this timeout is if the script incorrectly sets the shell prompt. By default, this causes each command to wait 20 seconds before moving to the next command and can trigger one of the client timers.

E.4.2. Client Timers

Client timers are set using the clienttimer Tcl command (see Section E.2.2, “ clienttimer ”). If a client timer expires, the application start is canceled with a fatal ErrApplicationServerTimeout error.

The client timers are defined in the vars.exp login script.

The following table lists the available client timers and their default values.

Timer

Default Value

timers(login)

timeouts(prelogin) + 10 seconds

timers(env)

40 seconds

timers(runmain)

40 seconds

timers(build)

25 seconds

timers(total)

5 seconds

timers(login)

The total time for the complete login phase, from making the connection to receiving the first shell prompt.

The timers(login) timer must be large enough to cover all of the login phases. Each individual phase of the login (login prompt, password prompt, shell prompt) might last up to the number of seconds defined for the timeouts(prelogin) timeout. The value of this timer must always be greater than timeouts(prelogin) Expect timeout.

If you increase the timeouts(prelogin) Expect timeout, increase the timers(login) timer as well so that the difference between them is never less than 10.

timers(env)

The total time from receiving the first shell prompt until all of the application server environment variables have been exported.

timers(runmain)

The total time from setting the last environment variable to starting the main application.

timers(build)

The total time taken to build the command line to be executed. This timer is only used when starting Windows applications that use the SCO Merge protocol.

Note

The SCO Merge protocol is no longer supported and can only be used by legacy SGD Windows application objects.

timers(total)

The total number of client timers. Only change this setting if you add or remove a client timer.

E.4.3. Other Timeouts

The procs.exp login script includes a three-second timeout when issuing commands. This is defined in the proc wait_for_prompt procedure.

The Execution Protocol Engine has a default timeout of 180 seconds (three minutes). This timeout starts when the request to start an application is received and removed when the application startup has completed successfully. If it expires, the application startup is canceled. This timeout is specific to each SGD server.

Use the following command to change this timeout:

$ tarantella config edit \
--tarantella-config-execpeconfig-maxlaunchtime secs
Note

Use the --array option with this command to change this timeout for all the SGD servers in the array.