28.11.10

SAP Note 10403 - Starting external programs.

Symptom

External CPI/C programs are not started.

Cause and prerequisites

The requirements for starting an external program have not been met.

Solution
Requirements for starting external CPI/C programs:

1) Gateway and CPIC program run on the same computer:
a) CPIC program must appear in the search path of the (Unix)
identifier under which the gateway was started (normally c11adm,
called the "Gateway identifier" in the following).
b) The CPIC program must be executable under the gateway identifier
(the program is started using fork-exec).
c) The CPIC program must be in the search path of the Gateway
identifier (check: call which under the Gateway
identifier.
d) The started program must try to log on to the Gateway within the
time set in the gw/cpic_timeout parameter. Otherwise, the
connection is broken with a timeout.

2. Gateway and CPIC program run on different computers:
a) The gateway identifier must be present on the computer where
the CPIC program is to run (User + HOME dir. + ...)
b) Starting programs on the remote computer must be allowed for the
gateway identifier from the gateway computer. To do this,
either the .rhosts file of the gateway identifier in the HOME
directory must be maintained (it must contain a line with the
gateway computer) or the /etc/hosts.equiv file must be
maintained.
For more information, refer to the section on "remsh" in the
the manual. To test, you can invoke the call remsh computer> date under the gateway identifier on the gateway
computer.
c) If the remote shell in your computer is not called remsh
(if you use a Unix 5.4 system, for example),
you must set the gateway parameter gw/remsh to the correct name
(which is normally "rsh" in such cases). You may have to use the
complete path name. To check whether the remote shell is found,
use the Unix command "which remsh" or "which rsh" under the
gateway identifier.
unter der Gateway-Kennung aufrufen.
d) The CPI-C program must be able to run under the Gateway
identifier (the program is started with fork-exec).
e) The CPI-C program must be located in the search path of the
Gateway identifier (check: call which under the
Gateway identifier).
f) The started program must try to log on to the Gateway within the
time set in the gw/cpic_timeout parameter. Otherwise, the
connection is broken with a timeout.
g) The Gateway service sapgwxx (here xx specifies the system ID No.)
must be defined for the remote computer.

Note, that remote shell is not generally available on NT platforms!

To analyze the error cause proceed as follows:


a) Check the trace file dev_rd of the Gateway read process. All
data output and error messages of the remote shell are redirected to this file. You may find error messages such as: "remsh: connection refused".
b) If you are using a NT platform: make sure that the program is to run locally. You cannot start with remote shell. Instead, install a Gateway on the remote host for starting, or use registered programs.

If you do not find any trace lines in dev_rd:

c) Replace the external program by a script, which generates a log
during the flow. Thus you can determine whether the external program
starts.

Example:

#!/bin/csh
echo "start erfolgt" >> protocol

d) If the external program starts, but does not execute a connect to the
Gatewayt: Activate the trace for the external program. To do this
you have the following options:

- As of Release 3.0D you can generally activate a trace for external
programs in the Gateway monitor. The trace level is then imparted
via a parameter. Link the external programs also with
3.0D libraries.

- For older Releases "frame" the external program with a script.
Before you call the variable CPIC_TRACE set the value to two. Thus
the trace file CPICTRC.. is created.

Example:

#!/bin/csh
setenv CPIC_TRACE 2
exec

Key word: CPIC

Additional key words

CPIC, timeout, return code 242, start external programs, Gateway CM_RESOURCE_FAILURE_RETRY

No comments:

Post a Comment