I am finding a few differences from 4.3+.
One is LIBPATH is not passed on to the
job when submitting it in the batch queue.
How do I disable this behavior? Or shall
I say how can I pass on to the child process
the LIBPATH variable?
Thanks in advance.
Sorry to give such a trivial answer, but your description seems to
suggest that you didn't export the environment variable.
Does the problem go away if you type
export LIBPATH
before invoking the batch job?
Yours,
Laurenz Albe
Confirm the described behavior on both versions.
Solution?
Bernard Dhooghe
A script submits a job to a batch queue:
qprt -P$myqueue -C -T "$PROGID" qbatchexec
The script that submits the above job determines the
queue name (in $myqueue variable) that the job will run under, export all
variables
needed by qbatchexec (another script), including LIBPATH.
When qbatchexec is under the control of the batch queue, I echo $LIBPATH
at the beginning of the script. AND LIBPATH is empty!
This is the scenario.
Thanks for any input on this.
"Laurenz Albe" <inv...@spam.to.invalid> wrote in message
news:11295336...@proxy.dienste.wien.at...
I do not know if it helps but i have found on aix 5.1 that if i change
from a lower security and a different shell to root i will lose PATH
and LIBPATH environment. PATH is set to absolut minimum plus extensions
in root's profile.
LIBPATH is wiped out.
Example: ( ksh -> bash -> ksh )
login as root (ksh)
$ echo $LIBPATH
/usr/lib
$su - bashuser
$ echo $LIBPATH
/usr/lib
$su - root
$ echo $LIBPATH
[EMPTY]
The same for a ksh-user ( ksh -> ksh -> ksh )
login as root (ksh)
$ echo $LIBPATH
/usr/lib
$su - kskuser
$ echo $LIBPATH
/usr/lib
$su - root
$ echo $LIBPATH
/usr/lib
So you might check ' which process does have which right' for each
process in you command chain.
You should read also:
http://publib.boulder.ibm.com/infocenter/pseries/topic/com.ibm.aix.doc/libs/basetrf1/exec.htm?resultof=%22%6c%69%62%70%61%74%68%22%20%22%6b%73%68%22%20
Technical Reference: Base Operating System and Extensions, Volume 1
exec: execl, execle, execlp, execv, execve, execvp, or exect Subroutine
...
The LIBPATH variable, when set, is used in favor of LD_LIBRARY_PATH;
otherwise, LD_LIBRARY_PATH is used. These library path variables are
ignored when the program that the exec subroutine is run on has more
privilege than the calling program (for example, an suid program).
...
hth
Hajo
BUT the parent/child/more_child processes are running within my own
environment. LIBPATH is always blank in all child processes. I may
have to re-export LIBPATH in all scripts as a workaround.
"Hajo Ehlers" <ser...@metamodul.com> wrote in message
news:1129574638....@o13g2000cwo.googlegroups.com...
.. exec subroutine is run on has >>>more privilege<<< than the calling
program
So from my understanding your qbatchexec will be started in the
follwoing order
script -> qprt -> qbatchexec
Since qprt has the owner bin:bin i would think that is has more
privilege then the script that will exec qprt.
A solution would be to create a perl suid script which will start the
qprt or like you said all final scripts have to reimport the LIBPATH
variable.
hth
Hajo