Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Use of FGLPROFILE environment variable  (Read 10719 times)
Brad D.
Posts: 8


« on: May 13, 2020, 05:15:59 pm »

In our environment (BDL 3.10.09), we have both a development instance and a production instance running on the same machine(a VMWare virtual instance actually).  As such, we need to have both development and runtime licenses available on the same machine.  We use the License Manager to hold both types of licenses.  We have but one directory for the BDL which serves for both development and production.

We run into an issue in that the license manager does not seem to be able to handle multiple license types.  The license number is controlled by the fglprifle file in $FGLDIR/etc.  We have tried to create two of these, fglprofile.dev and fglprofile.rt for the respective environments using the environment variable $FGLPROFILE to point to the proper file.  Unfortunately BDL reports an error saying that it cannot find the file fglprofile and ignores the value in the environment variable.  It looks like this is also the case in 3.20.

This does not seem to be the expected behaviour given the description of the FGLPROFILE variable in the manual and I quote:

"The FGLPROFILE environment variable defines a list of configuration files to be used by the runtime system."

In my test, the BDL ignores this entry entirely.

Am I doing something wrong?
Gary C.
Posts: 109


« Reply #1 on: May 13, 2020, 05:38:47 pm »

Hi
Hopefully I have understood your issue correctly. I have never had an issue with the use of the FGLPROFILE environment variable. We use Linux and for our non interactive and non GUI sessions we set the variable like this snippet:

Code
  1. TEQDIR=/opt3/teq
  2. FGLDIR=/opt3/fourjs/fgl
  3. GREDIR=/opt3/fourjs/gre
  4. FLMDIR=/opt3/fourjs/flm
  5. FGLASDIR=/opt3/fourjs/gas
  6.  
  7. FGLRESOURCEPATH=$TEQDIR/etc
  8. FGLPROFILE=$FGLRESOURCEPATH/fglprofile
  9.  
  10. export FGLPROFILE FGLAPPSERVER FGLLDPATH LD_LIBRARY_PATH CLASSPATH
  11.  

For our interactive sessions our xcf file looks like this snippet:

Code
  1. <APPLICATION Parent="defaultwa">
  2.        <RESOURCE Id="res.teqdir" Source="INTERNAL">/opt3/teq</RESOURCE>
  3.        <RESOURCE Id="res.teqdir.bin" Source="INTERNAL">$(res.teqdir)/bin</RESOURCE>
  4.        <RESOURCE Id="res.teqdir.jar" Source="INTERNAL">$(res.teqdir)/jar</RESOURCE>
  5.        <RESOURCE Id="res.teqdir.poi" Source="INTERNAL">$(res.teqdir.jar)/poi-4.1.0</RESOURCE>
  6.        <RESOURCE Id="res.teqdir.etc" Source="INTERNAL">$(res.teqdir)/etc</RESOURCE>
  7.        <EXECUTION>
  8.                <ENVIRONMENT_VARIABLE Id="FGLRESOURCEPATH">$(res.teqdir.etc)</ENVIRONMENT_VARIABLE>
  9.                <ENVIRONMENT_VARIABLE Id="FGLPROFILE">$(res.teqdir.etc)/fglprofile</ENVIRONMENT_VARIABLE>
  10.                <PATH>$(res.teqdir.bin)</PATH>
  11.                <MODULE>teqstart.42r</MODULE>
  12.        </EXECUTION>
  13. </APPLICATION>
  14.  

For our web services, our xcf file looks like this snippet:
Code
  1. <APPLICATION Parent="ws.default" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://4js.com/ns/gas/3.10/cfextws.xsd">
  2.  <RESOURCE Id="res.teqdir" Source="INTERNAL">/opt3/teq</RESOURCE>
  3.  <RESOURCE Id="res.teqdir.bin" Source="INTERNAL">$(res.teqdir)/bin</RESOURCE>
  4.  <EXECUTION>
  5.    <ENVIRONMENT_VARIABLE Id="FGLPROFILE">$(res.teqdir)/etc/fglprofile</ENVIRONMENT_VARIABLE>
  6.    <PATH>$(res.teqdir.bin)</PATH>
  7.    <MODULE>gwssrvr</MODULE>
  8.    <POOL>
  9.        <START>0</START>
  10.        <MIN_AVAILABLE>0</MIN_AVAILABLE>
  11.        <MAX_AVAILABLE>1</MAX_AVAILABLE>
  12.    </POOL>
  13.  </EXECUTION>
  14. </APPLICATION>
  15.  

When developing in Studio, I set the FGLPROFILE variable via an environment variable.

Have you checked you are exporting the variable and checked the file permissions?

Gary

Brad D.
Posts: 8


« Reply #2 on: May 13, 2020, 06:06:28 pm »

Hi Gary:

Thank you for your reply.  Yes I have made sure that the variable is exported and that the permissions are read for world.  I noticed is all of your posts below that the filename you use is fglprofile.  When I do that, it works fine but in our case the filenames are fglprofile.rt for run-time and fglprofile.dev for development.  We do this only to segregate the license as these are identified in the fglprofile file for the license manager for each environment.

When we use these different filenames, BDL will not run and reports that it cannot find the fglprofile file even if the FGLPROFILE environment variable contains the file in question.  The only way I get around this is by creating a symbolic link as in:

fglprofile->fglprofile.rt or fglprofile.dev

which of course invalidates running both environments at the same time.

The underlying question here is how do I run both a development environment and a production environment on the same Linux instance where the production environment uses different licenses that the development while maintaining only one BDL directory tree?
Gary C.
Posts: 109


« Reply #3 on: May 13, 2020, 06:14:55 pm »

Hi
That is strange. I have just amended the settings in my test environment to set FGLPROFILE to point to a different file to mimic your requirement:

Code
  1. gary@nancy:/opt3/teq/bin$ echo $FGLPROFILE
  2. /opt3/teq/etc/fglprofile.rt
  3.  

I then copied the original file to the new one and the applications still ran OK.
Laurent G.
Four Js
Posts: 110


« Reply #4 on: May 13, 2020, 06:23:28 pm »

Hi Brad,

This is strange indeed as it should work as documented + the License Manager will allow you to only install one FGLDIR directory.

However, the FLM doesn't mix license types indeed: so one unique license wouldn't be able to be runtime and dev at the same time and several licenses of different types can't be bundled to create a bigger pool.

If you get stuck, contact your local support and we will take a closer look at your environment with you

Cheers,

Laurent
Brad D.
Posts: 8


« Reply #5 on: May 13, 2020, 06:31:39 pm »

This is what I get:

# echo $FGLPROFILE
/var/opt/fourjs/fglgws-3.10.09/etc/fglprofile.dev
# ls -l /var/opt/fitrix_610/fourjs_dev/etc/fglprofile.dev
-rw-r--r-- 1 root root 10303 2020-04-01 11:57 /var/opt/fitrix_610/fourjs_dev/etc/fglprofile.dev
# fglrun *42r -d sample
ERROR(-6323):Can't load factory profile '/var/opt/fourjs/fglgws-3.10.09/etc/fglprofile'.
SYS ERROR(2):No such file or directory
# ls -l /var/opt/fourjs/fglgws-3.10.09/etc
total 52
drwxrwxr-x  2 fitrix fitrix  4096 2020-05-13 12:17 .
drwxr-xr-x 20 fitrix    502  4096 2018-01-18 14:04 ..
-rw-r--r--  1 fitrix fitrix  4011 2017-11-08 12:12 charmap.alias
-rw-r--r--  1 fitrix fitrix  8282 2017-11-08 12:13 dbdinfo.xml
-rw-r--r--  1 root   root   10303 2020-04-01 11:57 fglprofile.dev
-rw-r--r--  1 fitrix fitrix 10303 2018-01-18 14:06 fglprofile.rt
-rw-r--r--  1 fitrix fitrix  3890 2017-11-08 12:12 termcap
# ls -l $FGLPROFILE
-rw-r--r-- 1 root root 10303 2020-04-01 11:57 /var/opt/fourjs/fglgws-3.10.09/etc/fglprofile.dev

Laurent:
I am not trying to use only one license but am segregating them by using separate fglprofile files which identify the license to use.  I have only one FGLDIR and the license manager includes both licenses but only one should be used at a time if the proper file was found through the use of the FGLPROFILE environment variable.
Laurent G.
Four Js
Posts: 110


« Reply #6 on: May 13, 2020, 06:52:15 pm »

Ok that's expected

When starting a Genero program, the runtime will always try to load the 'factory' $FGLDIR/etc/fglprofile no matter what so it needs to be there regardless of what you set your FGLPROFILE environment variable to.

The best practice is to leave config file that comes with the install under $FGLDIR, $FGLASDIR, ... intact and just add/replace your specific settings in your own custom files. So put your 2 .rt and .dev files along where your application files are and point FGLPROFILE to it

Note also that you can split your custom entries into several logical files. For example, I have one just with license entries and one for ODI entries (same could go for Web Services, Mobile, ...)

Laurent
Brad D.
Posts: 8


« Reply #7 on: May 13, 2020, 06:57:28 pm »

Ok.  That works.  I would suggest that you change the documentation to reflect the fact that the fglprofile must be there and that additional files can be added if necessary.  It certainly does not read that way now.

Thanks for your help Laurent.
Laurent G.
Four Js
Posts: 110


« Reply #8 on: May 13, 2020, 07:09:33 pm »

YW Brad and agreed,

I was looking to send a link to the doc page in my last comment that explains that rule and couldn't find it ... I swear it used to be there or is somewhere still buried

Laurent
Laurent G.
Four Js
Posts: 110


« Reply #9 on: May 13, 2020, 07:12:12 pm »

Duh ... sorry

https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_EnvVariables_FGLPROFILE.html

I guess it could be more specific about the fact that it always reads it no matter what FGLPROFILE is set to.

Cheers,

Laurent
Sebastien F.
Four Js
Posts: 509


« Reply #10 on: May 13, 2020, 08:35:03 pm »

Please check also:

https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_fglprofile_001.html

There is a link at the bottom of the page of the FGLPROFILE environment variable.

You can also type "FGLPROFILE" in the search field or index field to find these topics.

What is missing?

Seb
Sebastien F.
Four Js
Posts: 509


« Reply #11 on: May 13, 2020, 08:37:42 pm »

Is this the page you are looking for regarding the loading of FGLDIR/etc/fglprofile ?

https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_fglprofile_005.html

Seb
Sebastien F.
Four Js
Posts: 509


« Reply #12 on: May 13, 2020, 08:47:06 pm »

There is a confusing/wrong sentence in the FGLPROFILE env var topic:

Quote
If FGLPROFILE is not set, the runtime system reads entries from the default configuration file located in $FGLDIR/etc/fglprofile.

FGLDIR/etc/fglprofile is always read first no matter if FGLPROFILE env var is defined or not.

This will be fixed.

Sorry for that.
Seb
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines