Operating System - HP-UX
1835217 Members
2346 Online
110078 Solutions
New Discussion

/etc/profile and environment variables

 
SOLVED
Go to solution
lastgreatone
Regular Advisor

/etc/profile and environment variables

There is a startup script for the httpd in /sbin/rc3.d that should pick up environment variables that have been plugged in /etc/profile, it does not. The startup script must be started manually after system bootup. Questions:, is the startup script in the correct run level? Are the environment variables located in the correct sequence and entry level in /etc/profile? see below:
# ORACLE and Apache related environmental variables
#
JAVA_HOME=/opt/java; export JAVA_HOME
TMPDIR=/home/tmp; export TMPDIR
TMP=/home/tmp; export TMP
TNS_ADMIN=/etc; export TNS_ADMIN
LANG=en_US.iso88591; export LANG
NLS_LANG=american_america.WE8ISO8859P1; export NLS_LANG

ORACLE_BASE=/u01/app/oraias; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/IAS102; export ORACLE_HOME

PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/java/lib; export LD_LIBRARY_PATH

SHLIB_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/Apache/Apache/libexec:$ORACLE_HOME/panama/lib:SHLIB_PATH; export SHLIB_PATH

CLASSPATH=${ORACLE_HOME}/jdbc/lib/classes12.zip:${ORACLE_HOME}/rdbms/jlib/jmscommon.jar:${ORACLE_HOME}/rdbms/jlib/aqapi11.jar:${ORACLE_HOME}/Apache/jdk/lib/classes.zip:${ORACLE_HOME}/sqlj/lib/translator.zip:${ORACLE_HOME}/sqlj/lib/runtime12.zip:.:${ORACLE_HOME}/lib/aurora_client.jar:${ORACLE_HOME}/lib/vbjorb.jar:${ORACLE_HOME}/lib/vbjapp.jar:${ORACLE_HOME}/jlib/javax-ssl-1_2.jar:${ORACLE_HOME}/jlib/jssl-1_2.jar; export CLASSPATH
3 REPLIES 3
Joseph C. Denman
Honored Contributor

Re: /etc/profile and environment variables

Have you check your /etc/rc.log to see what errors if any you are receiving at startup?

Be sure in your startup script you are issuing the "su -" vs "su"

...jcd...
If I had only read the instructions first??
lastgreatone
Regular Advisor

Re: /etc/profile and environment variables

No errors on this specific startup script. The DBA did not put su - in the script since it has to be started by root. So does root pickup the environment variables from /etc/profiles?
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: /etc/profile and environment variables

Hi,

/etc/profile typically has some conditional code so that that may be your problem.

However, /etc/profile is not the typical/conventional HP-UX way to do this.

1) In /sbin/init.d you should have a script httpd (for example) that is sybolically linked to S entries in /sbin/rc3.d and K entries in /sbin/rc2.d.

2) The variables used and exported by the sbin script should be in /etc/rc.config.d and also be named httpd (to match the /sbin/init.d/httpd script).

You can clone a script from /sbin/init.d/template.

Regards, Clay
If it ain't broke, I can fix that.