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