NPRao
21st November 2001, 03:52
Hi,
I would like to know how the baan shell imports the environment variables from UNIX.
Where can we change the environment variables which are listed by the env command?
I am facing a problem on our system now.
the echo $HOME returns empty, the $USER name is correct, the $LOGNAME is set to ROOT ( thats security risk, scary) while the $BSE shows up sometimes and sometimes its NULL too.
Any information will be helpful...!!!
Thanks!
JamesV
21st November 2001, 13:26
First of all I am assuming that you are using BW.
The environment variables for a Baan user on UNIX can be set in a number of ways:
1. As a command line option in the BW client with the
-- -set VARIABLE=VALUE syntax. For example, you can set the INFPROF environment variable with -- -set INFPROF=0.01.
2. In a bshell wrapper.
In this method you either call a different program from the BW client (like bshell.sh) or you change $BSE/lib/ipc_info to call a wrapper script before invoking the bshell6.x executable. You can then set the environment variables within the wrapper script.
3. In tabledef6.x
The environment variables related to the connection string for the database can be set in $BSE/lib/tabledef6.x. For example the ORACLE_HOME, TWOTASK or INFORMIXDIR are commonly set in the parenthesis that list the driver environment variables.
4. And of course, the normal UNIX default sources.
Well I could go on but I need to get going to work, so I will check in later...
-- Jim
patvdv
21st November 2001, 19:36
You can also put ENV variables in your $BSE/lib/defaults/db_resource file. Just be careful that the usual expression operator must be changed from = to :
e.g:
TNS_ADMIN:/etc
NPRao
25th December 2002, 07:07
Just wanted to share the info, I think this might be valid in our BaaN Version-5.2 I am not sure on other versions.
It appears there is a way to set environment variables within Baan.
Create a file $BSE/lib/bse_vars
Place assignments within the file
ie.
BSE_OUT=/app/lms/lms/opt/sy16/bse/edi_out
VAR=/app/lms/lms/var
EDI_IN=/app/lms/lms/edi_in
EDI_OUT=/app/lms/lms/edi_out
etc....
After the changes are made to the bse_vars file then the bshell has to be bounced/restarted to get the new environment variables to be active/picked up.
Francesco
26th December 2002, 07:09
Lets not forget the $BSE/lib/defaults/bshell and /all files (for BaanERP users only). Also usernames are accepted in the defaults directory. For instance, the file $BSE/lib/defaults/bastard could have environment settings that are specific to me ;)
It certainly isn't very transparant anymore in the later Baan versions. Does anybody happen to know the exact load order in which all these files are read?
That would be helpful for future trouble shooting.
OmeLuuk
27th December 2002, 14:28
There you can use this,... never guessed ... setting:
-- -keeplog -logfile show_file_and_settings -dbgres -dbgfile
With dbgfile you can see what files are read in what sequence and the set resources will be shown. The last set are the active ones.
JamesV
16th January 2003, 20:34
PRIORITIES
The following priorities are valid (from highest priority to lowest):
1) Set as Environment Variable
2) Set in User file
3) Set in file $BSE/lib/defaults/bshell (or other name, depending on bshell name)
4) Set in file $BSE/lib/defaults/all or db_resource
So, when you set a resource variable in the file $BSE/lib/defaults/all, you can overrule this resource variable by setting the same resource variable as environment variable.
See Baan Solution 110908 for more details
-- Jim
NPRao
16th January 2003, 20:52
James,
I dont think the option-2 is right. I have a note from a BaaN support guy for one of my cases about entries in the $BSE/lib/user/u<user-id> file.
To the best of my knowledge I tried to map the parameters in the
Session to uuser file and please see my comments for the same in the below mail from you with your questions.
As I have been repeatedly impressing upon a User is not supposed to handle or manipulate any part of these system generated files like uuser.
If some one has caused any wiered entries against the standard
procedure I am helpless.
Better drop those users and recreate through standard procedure
only.
I don't advise any corrections in these files.
Please note that the information that I have provided is to the best of my knowledge and belief and I cant authenticate as I do not find anydocumentation to this effect.
OmeLuuk
12th May 2003, 13:58
Test one: ba6.1 -- -set SESSION_TIMEOUT=99 -dbgres -dbgfile -keeplog -logfile logged.res ttaad4100open /usr4/b40_c4/bse/lib/defaults/all
Loading resource file /usr4/b40_c4/bse/lib/defaults/all (class = bshell)
Setting resource 'session_timeout' to '99'
open /usr4/b40_c4/bse/lib/defaults/bshell
Loading resource file /usr4/b40_c4/bse/lib/defaults/bshell (class = bshell)
Setting resource 'session_timeout' to '99'
open /usr4/b40_c4/bse/lib/user/ubsp
Loading resource file /usr4/b40_c4/bse/lib/user/ubsp (class = bshell)
Setting resource 'session_timeout' to '99'Note all settings of session_timeout are overruled with commandline setting. This has highest priority.
Test two: ba6.1 -- -dbgres -dbgfile -keeplog -logfile 1ogged.res ttaad4100open /usr4/b40_c4/bse/lib/defaults/all
Loading resource file /usr4/b40_c4/bse/lib/defaults/all (class = bshell)
Setting resource 'session_timeout' to '900'
open /usr4/b40_c4/bse/lib/defaults/bshell
Loading resource file /usr4/b40_c4/bse/lib/defaults/bshell (class = bshell)
Setting resource 'session_timeout' to '3000'
open /usr4/b40_c4/bse/lib/user/ubsp
Loading resource file /usr4/b40_c4/bse/lib/user/ubsp (class = bshell)
Setting resource 'session_timeout' to '200'Setting in ubsp has highest priority, then bshell, then all. BTW... I do not have a db_resource file...
By the way...NPRao:I don't advise any corrections in these files. I agree on this one, but in the first solutions (implementation phase) regarding session_timeout it was adviced to enter it manually in the ufiles...
TheBurniou
7th June 2004, 18:43
I have to set some env vars equal to all users. One way mentionned by JamesV is to use $BSE/lib/defaults/bshell. Do I only have to create a bshell named file in the $BSE/lib/defaults directory and type my new env vars in it to have them correct while using baan ?
We use baanERP.
TheBurniou
8th June 2004, 15:34
Since I wrote my new path vars in the bse_vars file, in baan program script I can access the vars by the command get_env$(). But when i start a report session and choose a rewrite or append type device, I would like to write to a file on my new var directory. I can't access my new vars but the ${BSE} works fine.
Has anyone an explaination ?
lbencic
8th June 2004, 16:50
If the variables are available in the program script, try putting them as an Input Field on the report in Maintain Reports.
NPRao
21st June 2004, 21:55
Since I wrote my new path vars in the bse_vars file, in baan program script I can access the vars by the command get_env$(). But when i start a report session and choose a rewrite or append type device, I would like to write to a file on my new var directory. I can't access my new vars but the ${BSE} works fine.
Has anyone an explaination ?
[DEV:bsp]/app/lms/lmss/opt/bse/lib>cat bse_vars
LMS_VAR=/app/lms/lmss/var
LMS_OPT=/app/lms/lmss/opt
LMS_EDI_IN=/app/lms/lmss/var/edi_in
LMS_EDI_OUT=/app/lms/lmss/var/edi_out
LMS_LOG=/app/lms/lmss/var/logs
BSE_EDI_OUT=/app/lms/lmss/opt/bse/edi_out
BSE_EDI_IN=/app/lms/lmss/opt/bse/edi_in
In the program script -
iepath = getenv$("LMS_VAR") & "/infrastructure/migrations/"