Installation and Configuration Guide : Installing and Configuring OpenROAD on UNIX or Linux : How You Configure COM : How You Create a Server Initialization Script
 
Share this page          
How You Create a Server Initialization Script
When Visual MainWin launches an out-of-process COM server with the identity of the launching user, it helps to ensure that the COM server inherits its environment (MWHOME, LD_LIBRARY_PATH, and so on) from the calling client process. In some situations, however, Visual MainWin cannot automatically pass the client environment to the server. For example, when:
The client is on a remote host.
The server is set up to run as a specific user.
In both cases, a script must be provided to Visual MainWin to set the proper environment for the COM server and launch it. In case the environment cannot be copied from the client process, the Visual MainWin DCOM service control manager (RPCSS) uses the script to launch the COM server.
The following points explain how to write a server initialization script, its format, file permissions for the script, and where the script is located at runtime.
Writing a server initialization script
There are no special requirements for the language in which the script is written. The only requirement is that it be executable and it achieves the remaining objectives, following.
Contents of the script
The script should contain statements that:
Set up the Visual MainWin runtime environment
Set up any additional environment variables
Launch the server executable with proper parameters
File permissions for the script
The script should enable read and execute permissions for all users authorized to start the COM server.
Example script
The following is an example of an initialization script:
#! /bin/tcsh -f
source ~/.orIIcsh
setenv DISPLAY {hostname | IP_address}:0
exec $*
Location of the initialization script for Visual MainWin at runtime
Visual MainWin searches for an initialization script in the directory where the server executable resides. It performs the search according to the following search rules:
1. Look for a file named server.init, where server is the server name. For example, if the server is registered by the name oraso, the initialization script file name is expected to be oraso.init.
If no script is found according to this rule, go to the next rule.
2. Search for a script named init.
If Visual MainWin finds no script based on the above rules, RPCSS returns a “Server execution failed” error code to the calling process.