Nirjan,

On 4/26/21 14:19, Niranjan Rao wrote:
On 4/14/21 5:29 AM, Rony G. Flatscher (Apache) wrote:
A JVM
AFAIK would not honor changes to the environment after it got started

A serious question. Apologies for selective selection from the response.

Are there any operating systems where change in environment is automatically reflected in child process?

That would be a fairly chaotic system. I don't know of any that do this kind of thing.

My understanding was, processes always inherit parent environment and
have no way of knowing what changed.
A copy of the parent environment is made into the child process, which diverges from that point forward.

The reason JVMs "would not honor changes to the environment after it got started" is because most components that configure based upon envirnment variables (or system properties for that matter) only check them when first initialized. If you change an environment variable in a process (whether from the inside or the outside), it only changes behavior of the variable's value is directly-checked periodically instead of "just once at startup."

If you managed to spawn a process with different parent based on your operating system, then you might see new values, but most of the spawn/exec calls (regardless of language of implmentation) inherit the exact same environment variables. Some calls do allow you to setup the environment variables for child process but struggling to figure out where grandparent process informed parent about environment change which can be sent to grandchild.

I don't believe any of that can happen, at least not in theway you describe. Of course, IPC does exist and you *can* send data between processes, so a grantparent process could theoretically tell the grandchild process "hey you should set FOO=bar" but the grandchild process would have to support that kind of IPC and agree to make the change. The gp process can't just reach-in and change the environment.

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to