Our application has a couple of shell scripts that are called from web-based Oracle Forms 10g, running on multiple Solaris 10 servers. We've discovered recently that the shell scripts are not running with the full permissions of the OAS user account that runs the forms. I added a echo User is $USER command to one script to display the Solaris user name, and it displayed just User is. When I used the id command instead, it did display that it was running as the correct user.
So, any thoughts on how to get the shell script to know who it is so it can read the files?
The aforementioned admin guys have double-checked everything they can think of, and swear up and down that everything is installed exactly the same as on all the other servers. The shell script is called using a HOST command from the forms.
We're on Forms 10g, Solaris 10, Oracle 10.1.0.4.2, and the Solaris account is running a ksh shell.
Thanks, Dan
Edit: Removed all the stuff about reports, as that problem was solved, but I am still interested if anybody knows why the shell scripts called from Forms via HOST command don't get a full login.
Update: Here is the argument passed to the HOST command (yes, the argument is 3 lines with line feeds):
exec > /u01/app/swms/forms/edoc_stage/Z05273_tibco_edoc.log
exec 2>&1
/u01/app/swms/forms/edoc_stage/tibco_edoc.sh DMSPV01\^NTSTE101 SWMSeDocTIBCO-d1 XXXXXX 082200413
I originally tried just calling the script, like the last line of the argument, but wasn't getting anywhere, so I copied what another script call was doing and modified it. That's where the first two lines came from.
And here's the script itself. I had to add the 3 lines starting with PATH=/usr/bin to get the .profile to execute. What I want to know is why that was necessary: why doesn't the shell do that automatically?
#!/bin/ksh
PATH=/usr/bin
USERNAME=`id | cut -d'(' -f2 | cut -d')' -f1`
. ~$USERNAME/.profile
TIBCO_HOME=${ORACLE_HOME}/forms/java
JAVA_HOME=/usr/java
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}/PVIntegration.jar
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}/wsdl4j-1.5.1.jar
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}/saaj.jar
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}/log4j-1.2.8.jar
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}/jaxrpc.jar
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}/commons-logging-1.0.4.jar
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}/commons-discovery-0.2.jar
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}/axis.jar
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}/activation.jar
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}/mailapi.jar
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}/WSProxy.jar
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}/xmlsec-1.4.2.jar
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}/wss4j-1.5.5.jar
CLASSPATH=${CLASSPATH}:${TIBCO_HOME}/Config.properties
export CLASSPATH
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${TIBCO_HOME}
export LD_LIBRARY_PATH
${JAVA_HOME}/bin/java -Xms128m -Xmx256m com.aps.ecm.clients.ECMClient $1 $2 $3 $4
/etc/passwd) on all servers, and the same.profile? Is$SHELLset? (Can't remember why I think that might be important). Is the script you're calling specifying which shell to run via#!/bin/kshor similar? Does explicitly invoking your.profilein your script, or even just manually settingUSER=$LOGNAME, make any difference? Are you using any other environment variables in the path to the file you're referencing? Might be helpful to see the argument you're passing to HOST, the script itself, and the error it produces..profileis the same on all servers.$SHELLis set to/bin/ksh. The script does specify the shell at the top. Manually settingUSERhad no effect, but explicitly invoking the.profiledoes have the desired effect. The only environment variables that are being used without being explicitly set werePATH,CLASSPATHandLD_LIBRARY_PATH. I will update the question with theHOSTcommand and it's argument, and the script.