Setting Environment Variables in execNative
Hi,
one of my customers has the following problem:
If using execNative with "userToRunAs" set to <whateveruser>, the current implementation of the Remote Agent doesn't work similar to "su - <whateveruser>". As a consequence of that, the environment variables etc. are not available (plus it is very hard to implement viable workarounds, if using SSH as connection method).
Question: Does it make sense to create a RFE to implement something that effectively "simulates" a login shell? Could be an extra boolean parameter for ExecNative "loginShell" which defaults to false.
Could somebody please elaborate on this?
-michti
[672 byte] By [
michti] at [2007-11-26 11:26:51]

# 2
Its a interesting point. Depending on environment variables that are not set explicitly by the deployment routines add an external dependency on the deployment.
It would work very well for existing environments (or make modeling less painful in existing environments) but its another thing that can cause the deployment to fail, when deploying out to new nodes. Wouldn't it be better to model such dependencies into execnative, so that you are sure that the deployment would work wherever you carry it out.
It may not always be possible to do that, especially if the SPS model doesn't include the values of those environment vars or if the values of those environment vars are machine specific. In those cases, would it better to explicitly model those environment variables as host vars or if thats too painful, have exec natives run appropriate scripts to configure their environments before running any actions.
That way such dependencies are explicitly modeled and you have fewer surprises when running those deployments again on new nodes. And your model can ensure that these vars are setup correctly before you start using them.
-Aj