Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run a tcl script file from SDO ?

Status
Not open for further replies.

veroL

Programmer
Jan 10, 2003
30
0
0
FR
Hello,
I have the following problem: I have to install data files on several machines running differend OS (Unix/Windows NT). But, I must copy on these machines only the files corresponding to them (the names of the files I must copy depend of the type of OS running on the machine and of the type of the machine). As i would like to avoid creating a "software installation kit" for each machine, I have done the following thing: I have created a KIT composed of one source volume (that contains all the data files and 2 files: install.cmd and install.tcl. install.cmd contains only the command "tclsh install.tcl" and install.tcl contains the tcl instructions that determine the type of the OS and the files to copy on the remote machine).
This works perfectly when i drag and drop my kit towards a windows NT machine but, for the unix machine,the job crashes and i get the following error message: "Procedure could not be started: file or pathname not found (A228102)". Note that tclsh is installed in /usr/local/bin on that unix machine, that /usr/local/bin is in the PATH variable, that typing "tclsh install.tcl" from the shell invite on the machine works alright and that, the same kit with "cp datafileUnix /tmp/datafile" in install.cmd doesn't crash and works alright. So, it seems that finding the install.cmd file is not the problem but that SDO doesn't find tclsh on unix systems whereas it finds it on windows...
Thank you in advance
Veronique
 
you say that 'typing "tclsh install.tcl" from the shell invite on the machine works alright' but are you the same user at that time as the SDO agent is when it does it?
excuse my ignorance if this is a dumb question as I'm not that clued up on *nix side of things. But I have seen this sort of situation occur under NT because of differing path/access rights of the SDO installer and the original devloper test account.
good luck.
 
Thank you for your answer. It was not a dumb question but infortunately, it hasn't solved my problem. The SDO agents on the unix machine are "root" user. "Root" Path contains /usr/local/bin. When I log in as root user on the unix machine and i type "tclsh install.tcl" from the shell invite, it works alright so, it is not a PATH problem i think. I also noticed something strange: when install.cmd contains only the command "env>/tmp/filename", the SDO console indicates that the job crashes but, if i look on the remote machine, the file "filename" was created and contains the same thing as if i typed the command "env" myself (still root user) from the shell invite.
Does anyone have any explanation of that?
 
If the install.cmd is returning a value that SDO doesn't like as its exit code then you will get a failure as far as SDO is concerned.
Within NT SDO scripts in my experience it is best to do some checking within your scripts and set a known return/exit value.
Not sure but if your command has the equivalent of "EXIT 0" then you should be OK. Its a good idea to create a template script with a predifined set of exit codes. This way you can just slot in specific job bits into standard things like an installation log file that details the stagesof more complicated installations.
 
Thank you, it works alright now; There were in fact 2 distinct problems. First, there were ^M caracters at the end of each line of the install.cmd file (due to a previous ftp transfer from Unix to windows that was made in ascii instead of binary mode). These special caracters cannot be seen from a "windows" text editor (but you can see them with vi under Unix) but they actually caused the bad exit value of the "env" command. As for the PATH, it is possible to modify the environment of the SDO agents for unix in the file "ca_sd" (on the unix machine) (so, there is no need to modify the root's .profile) (it can be helpful to know that if you are not the one who installed and started the agents...). Thanks again for your answers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top