Debugging Tools for Windows

Running in Crash Mode Remotely

There are many occasions when you must initiate ADPlus in crash mode from a local client computer to monitor a process that ends unexpectedly on one or more remote servers in a cluster of servers. Typically, on Microsoft Windows 2000, you can initiate ADPlus in crash mode remotely by using Terminal Services. However, because you cannot debug applications that are running in different window stations on Windows 2000, ADPlus disables crash-mode functionality when it detects that it is running in of a Terminal Services session.

Instead, you must first create a batch file that opens a Command Prompt window on the remote server that has been shared by using the Remote.exe utility. Then, schedule this batch file to run on the target server by using the AT command (which causes the command shell to run noninteractively, similar to a service). The remote command shell is then connected to a local workstation or client computer that uses the same Remote.exe utility that was used to start it.

To start a remote command shell on a server by using the AT command, you must follow the correct procedure on the remote server and the local client.

Ideally, you should install the debuggers on the local client computer. If you cannot install the debuggers on the local client computer, you should at least put a copy of the Remote.exe utility on the local client. The following procedure assumes that Debugging Tools for Windows package is installed in C:\Debuggers on the remote server and that this package (or at least Remote.exe) is installed in D:\Debuggers on the local client. Adjust this procedure to the actual installation on your computers.

To set up a remote command shell on the server, do the following:

  1. Create a new batch file that is named Remoteshell.cmd in the C:\Debuggers folder.
  2. Add the following line to this batch file:

    c:\debuggers\remote.exe /s "cmd.exe" remoteshell

  3. At the console on the server or in a Terminal Services session, open a new Command Prompt window, and type the following command:

    AT 15:00 c:\debuggers\remoteshell.cmd

    In this command, "15:00" is 1 minute later than the current time. For example, if the current time is 14:59, type 15:00.

  4. Wait for the AT command to run.
  5. At the command prompt, type AT without parameters to verify that the task has run without errors.

To connect to the remote command shell from the client, do the following:

  1. At a command prompt, move to the D:\Debuggers directory.
  2. Type the following command:

    remote.exe /c RemoteServer remoteshell

    In this command, RemoteServer is the name of the remote server.

    After you run this command, your local command shell is connected to the remote command shell that is running on the server, and all commands that you type locally are run on the remote server. For example, the dir c:\ command lists the contents of the remote server's drive C.

  3. In the remote command shell, run ADPlus in crash mode as if you were running it locally from the console. However, you must use the -quiet option to suppress all message boxes that ADPlus displays by default. If you do not use this option, the remote command shell stops responding (that is, hangs) after you run ADPlus and does not return to a prompt. Then, you must close the Command Prompt window on the server and start a new instance.
  4. To send a debug break (CTRL+C) to a process that ADPlus is currently debugging remotely through crash mode, use the Breakin.exe utility. By default, this utilityis installed together with the debuggers in the root of the debuggers directory. For example, to stop debugging IIS (Inetinfo.exe) that is running with a process ID of 1975, type the following command in the remote command shell:

    breakin.exe 1975

    Alternatively, you can use the Kill.exe utility to end any processes that are being debugged. This utility is located in the root directory of the Debugging Tools for Windows installation tree.

Build machine: CAPEBUILD