Application Takes Too Long to Launch or Fails to Launch Entirely

Introduction

There are a number of reasons an application may fail to launch, but if a Unix application periodically fails to launch, and/or takes a long time to launch, a common source of the problem is a shell prompt that the SGD login script doesn't recognize.  Note that this particular problem only affects applications hosted by Unix/Linux hosts. 

SGD uses login scripts, written in the expect scripting language, to perform "proxy" logins to the application server that's hosting the desired application.  This script is responsible for logging into the application server, setting up the environment, and launching the application.  The script is written to "expect" certain responses from the application server before sending the next command; if the shell prompt you're using isn't in the list of recognized shell prompts, the script can get confused, and out of sync.  The result of this is usually a long delay before the application launch proceeds, (30 seconds), and occasionally, failed launch attempts altogether.

One indicator that this is the problem is to click on the "Details" button in the "Connection Progress" dialog box during the launch attempt.  If you see something like:

Password:
Last login: Thu Jul 17 14:39:33 2008 from solx86

Sun Microsystems Inc.   SunOS 5.10      Generic January 2005

Starting the application..

+
echo -SYNC-
-SYNC-
+exec /bin/sh


Then it's likely that you're using a prompt string not recognized by the default expect scripts. There are simple fixes to correct this problem. 

Procedure

1.  One simple work-around is to simply reset your shell prompt on the target application server(s) to one that's already recognized by SGD.  These include '$', '%', '#', and '>'.  In your .profile, .bashrc, .cshrc, etc, set your shell prompt to one of these, and see if this resolves the issue.  If it does, you can simply continue to use this work-around.  Alternatively, you can add your unique shell prompt to the list of recognized prompts.

2.   To add a shell prompt to the list of shell prompts recognized by the SGD expect scripts, perform the following procedure:

# cd /opt/tarantella/var/serverresources/expect

# cp vars.exp vars.exp.org

edit vars.exp and locate the line (line 90 in SGD 4.40) as follows:

set prompts(prompt)              {\[\\\$%>\\\#\]((\[ \])\|(\u001b\[.))*$}

Edit the first field to include your unique prompt script (note that special characters must be escaped with the '\\\' prefix.)  E.g, to add the '+' prompt, the string should look like:

 set prompts(prompt)              {\[\\\$%>\\\#+\]((\[ \])\|(\u001b\[.))*$}

 Note the addition of the '+' sign.  Save this, and test.

Note:  Be aware that when upgrading your installation to a new version of SGD, these changes will be overridden.  

See also:  

SGD 4.40 Admin Guide - Login Scripts Supplied with SGD

SGD 4.40 Admin Guide - Login Script Errors

Applies to SGD Version:

All

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact