I don't understand what you are doing.
If you do
you should able to use it in the script.
Could you elaborate on this?
Thanks for the reply. I am doing following in run.sh.
It's setting environment variable "MYENV" for the child Java processes.
I want to set for run.sh process itself. I hope You got my requirement.
If you set the environment variable (via export) before calling run.sh it should be used by run.sh.
Yes. I tried that as well. "run.sh" is called form "jboss_init_redhat.sh"
I tried the same (export MYENV=xyz) in "jboss_init_redhat.sh" but that also didn't work. Any idea ?
This should work. What is your Linux/Unix version?
What exactly did you do? Could you post the extract of your script?
How did you realize that this is not working as expected?
Linux version : Red Hat Enterprise Linux Server release 6.5 (Santiago)
jboss_init_redhat.sh and run.sh files shared here: https://drive.google.com/folderview?id=0B9aqoDIYpWvAfmp0ZWJ0S3dBem9kN2xTS05PSFZMLS1CRFBtcDA1cTJvNUJVcHBiVUNTVVk&usp=sharing
You can see export INFA_APPLICATION_SERVICE_TYPE="ReportingService" in scirpts
I am checking through following command : xargs --null --max-args=1 < /proc/1902/environ (Eg;1902 is pid of run.sh). The environement variable not getting listed. (Through a Java program also, we are not able to see this environement variable for run.sh process)
I cannot read the files you mentioned in your URL.
But when I execute a script containing only these 2 lines (open SuSE 13.2):
and execute the following command afterwards:
xargs --null --max-args=1 < /proc/8985/environ | grep INFA
I get following feedback
Maybe I did not understand your issue correctly.
But you could also verify this by just adding: echo $INFA_APPLICATION_SERVICE_TYPE to run.sh
Did You set export INFA_APPLICATION_SERVICE_TYPE="ReportingService" through jboss_init_redhat.sh/jboss_init_suset.sh ?
I tried echo as well. It's not printing anything.
The files are shared here: https://jumpshare.com/b/VxUkvNlNN4iaQT6M2OFT
I think the issue in your jboss_init_redhat.sh is that this script is redirecting the output to null by default.
If you export the JBOSS_CONSOLE to something else (eg to a file) before starting this script you should find this log entries there.
Yes. Output is redirected to a log file.
I checked log file only. I updated the above url with one more file "console-redirect-log" . You can observe there "Service Type: "
I am not sure understanding you correctly.
Are you now seeing the environment variable in your logfile?
There might be the case that the export built-in command does not work correctly.
So you may try
INFA_APPLICATION_SERVICE_TYPE=ReportingService; export INFA_APPLICATION_SERVICE_TYPE
What if you use a very simple script to check:
In this case 2 should be empty