Environment variables incorrect at runtime?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
roblew
Charter Member
Charter Member
Posts: 123
Joined: Mon Mar 27, 2006 7:32 pm
Location: San Ramon

Environment variables incorrect at runtime?

Post by roblew »

I'm running 7.5.1A in impersonation mode and 8.1 in non-mapped mode (no credential mapping), both on RedHat Linux.

PROBLEM: When I run a job using a non-dsadm id, the HOME and USER environment variables are set to the dsadm user's values. The behavior seems to be the same in Server, Parallel jobs and job sequences in 7.5.1 and 8.1.

EXAMPLE:
For example, user "rob" runs a simple PX job which has External Source stage to a peek. The External Source stage runs the command "echo $HOME; echo $USER". I would expect to see the output "/home/rob" and "rob" as the results in peek, right? Instead, I see the results "/home/dsadm" and "dsadm". Similarly, if I run a sequence with an execute command stage with the command, "env > /tmp/env.out", I find the following values (note: the env.out file created is owned by "rob" user as expected):
USER=dsadm
HOME=/home/dsadm
I also tried running the same echo commands in a server job via the after-job subroutine, with the same results. I also see the same environment variable values in the "Environment variable settings" joblog entry.

If I run the same commands on the IS server, I get the USER as "rob" and HOME as /home/rob. Yes, I did source the dsenv file as that user before running the commands. Yes, this behavior is consistent across all our servers and various users.

I thought that with impersonation on, the DataStage processes would be run with the same id who ran the job (not dsadm id). I also thought this would be the same when running on 8.1 without any credential mapped users (i.e. running with shared user registry: "The credential mapping is not activated for this DataStage server. Your IBM Information Server credentials will be used.").

QUESTION:
I'm wondering if this is just a configuration issue on our environment, or if this is just the way DataStage does it (and I misunderstood how this all should work all along). We've been running DataStage for at least 3 years now and thought it was always running scripts and processes as the same id that ran the job, but just recently noticed this behavior with the environment variables.

Any help is much appreciated.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

When you run a job from a DataStage client, your agent process on the server (dsapi_server or dsapi_slave) is the one that actually issues the request. These inherit their environments from dsrpcd, which creates an instance of dsapi_server for each successful connection request from a DataStage client. It has always been thus.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
roblew
Charter Member
Charter Member
Posts: 123
Joined: Mon Mar 27, 2006 7:32 pm
Location: San Ramon

Post by roblew »

Thanks for the reply Ray.

OK, I understand now that the spawned server processes inherit the environment variables from dsrpcd. So, though the process is actually running under a user id, I need to set the environment variables explicitly (for example HOME and USER) from within the job or within any shell scripts that the job calls.
Post Reply