Flexnet 64 Bit License Vendor Daemon Development (Ubuntu)

From DDCIDeos
Jump to navigationJump to search

Overview

This page describes how to build the DDC-I FLEXnet 64-bit Daemon for Ubuntu(ddciflex) and supporting Flexnet applications required for a DDS release. DDC-I Linux products use FLEXnet 11.19.2. Supporting applications are built using all four versions of FLEXnet for various purposes. This Wiki page describes the building of Flexnet 11.19.2 on Ubuntu 20.04. When licenses are borrowed using OA's license borrowing dialog, the features are checked out in borrowed mode using the following:

11.19.2 - features used by OA, HeartOS and GCC (checked out using the javaUtil.dll)
11.19.2 - features used by Deos (checked out using check_11_19_2_feature)

Currently, everything is under configuration management control using SVN at https://deos.ddci.com/svn/DDCI/products/DDCI_Flexnet/
NOTE: This page does not address older DDC-I products such as DACS which use the ddciada.exe FlexLM daemon.

DDCI_Flexnet Directory Structure

The directories pertaining to Linux are described here. Windows directories are documented here: Flexnet_64_Bit_License_Vendor_Daemon_Development_(Windows)

~/DDCI_Flexnet

  • /DDCI_Flexnet_11.15.1_ubuntu
    • /CheckoutFeature
    • /DeosIntegSO
    • /FLEXnet_11.15.1
    • /javaflexlic
  • /DDCI_Flexnet_11.19.2_ubuntu
    • /CheckoutFeature
    • /DeosIntegSO
    • /FLEXnet_11.19.2
    • /javaflexlic
  • /FLEXnet_Downloads
    • /FLEXnet_10.8.0.7
    • /FLEXnet_11.9.1
    • /FLEXnet_11.15.1
    • /FLEXnet_11.19.2
  • /WiseSetup
    • /server_check

Steps for Upgrading to a New Windows Version of FLEXnet

Step 1: Check out the existing DDCI Flexnet repository from SVN

  1. cd c:
  2. svn co https://deos.ddci.com/svn/DDCI/products/DDCI_Flexnet DDCI_Flexnet

Step 2: Create a new directory for the new verion of FLEXnet

  1. cd DDCI_Flexnet
  2. mkdir DDCI_FLEXnet_11.19.2_ubuntu

Step 3: Create the directories for CheckoutFeature, DeosIntegDLL and javaflexlic

  1. cd DDCI_FLEXnet_11.19.2_ubuntu
  2. mkdir CheckoutFeature
  3. mkdir DeosIntegDLL
  4. mkdir javaflexlic
  5. mkdir FLEXnet_11.19.2

Step4: Copy the CheckoutFeature files from the previous version (e.g. DDCI_Flexnet_11.15.1_ubuntu/CheckoutFeature)

  1. cd DDCI_FLEXnet_11.19.2_ubuntu/CheckoutFeature
  2. cp ../../DDCI_Flexnet_11.15.1_ubuntu/CheckoutFeature/build.bat .
  3. cp ../../DDCI_Flexnet_11.15.1_ubuntu/CheckoutFeature/checkoutFeature.cpp .
  4. cp ../../DDCI_Flexnet_11.15.1_ubuntu/CheckoutFeature/Makefile .
  5. cp ../../DDCI_Flexnet_11.15.1_ubuntu/CheckoutFeature/stdafx.h .

Step5: Copy the DeosIntegDLL files from the previous version (e.g. DDCI_Flexnet_11.15.1_ubuntu/DeosIntegDLL)

  1. cd DDCI_FLEXnet_11.19.2_ubuntu/DeosIntegDLL
  2. cp ../../DDCI_Flexnet_11.15.1_ubuntu/DeosIntegDLL/build.bat .
  3. cp ../../DDCI_Flexnet_11.15.1_ubuntu/DeosIntegDLL/ddcix11.cpp .
  4. cp ../../DDCI_Flexnet_11.15.1_ubuntu/DeosIntegDLL/license_common.h .
  5. cp ../../DDCI_Flexnet_11.15.1_ubuntu/DeosIntegDLL/Makefile .
  6. cp ../../DDCI_Flexnet_11.15.1_ubuntu/DeosIntegDLL/stdafx.h .
  7. cp ../../DDCI_Flexnet_11.15.1_ubuntu/DeosIntegDLL/test.c .
  8. cp ../../DDCI_Flexnet_11.15.1_ubuntu/DeosIntegDLL/test_makefile .

Step5: Copy the javaflexlic files from the previous version (e.g. DDCI_Flexnet_11.15.1_ubuntu/javaflexlic)

  1. cd DDCI_FLEXnet_11.19.2_ubuntu/javaflexlic
  2. cp ../../DDCI_Flexnet_11.15.1_ubuntu/javaflexlic/build.bat .
  3. cp ../../DDCI_Flexnet_11.15.1_ubuntu/javaflexlic/com_ddci_common_ide_licensing_DdciLicense.c .
  4. cp ../../DDCI_Flexnet_11.15.1_ubuntu/javaflexlic/com_ddci_common_ide_licensing_DdciLicense.c=h .
  5. cp ../../DDCI_Flexnet_11.15.1_ubuntu/javaflexlic/flexnet_dll.cpp .
  6. cp ../../DDCI_Flexnet_11.15.1_ubuntu/javaflexlic/flexnet_dll.h .
  7. cp ../../DDCI_Flexnet_11.15.1_ubuntu/javaflexlic/JavaUtil_dll.mak .
  8. cp ../../DDCI_Flexnet_11.15.1_ubuntu/javaflexlic/license_comon.h .
  9. cp ../../DDCI_Flexnet_11.15.1_ubuntu/javaflexlic/StdAfx.h .

Step 6: Untar the content of DDCI_Flexnet\FLEXnet_Downloads\FLEXnet_11.19.2\FlexNetPublisher_11.19.2\Linux\x64_lsb-11.19.2.0_v6.tar.gz to DDCI_FLEXnet_11.19.2_ubuntu/FLEXnet_11.19.2

Step 7: Modify the files in the above directories as instructed below in the Modify the Files section.

Step 8: Build each one as instructed below in the Build Everything section.

Step 9: Release each one as instructed below in the Release Everything section.

Modify the Files

FLEXnet_<version> File Changes (11.19.2 and higher)

The FLEXnet directories each contain a number of files that must be customized for DDC-I, Inc. This section describes what files must be changed and why. For the 11.19.2 version of the product, there is Documentation, a 64-bit version of the product for Linux. 11.19.2 replaces 11.15.1
The Linux 64-bit version is in x64_lsb-11.19.2.0_v6.tar.gz.

The DDCI_Flexnet\DDCI_FLEXnet_11.19.2_ubuntu\FLEXnet_11.19.2 folder contains folders extracted from x64_lsb-11.19.2.0_v6.tar.gz:
To extract the files, use "tar -xf x64_lsb-11.19.2.0_v6.tar.gz"
There is an examples, machind and x64_lsb folder.

<FLEXNet_install_dir> = ~/DDCI_Flexnet/DDCI_Flexnet_11.19.2_ubuntu/FLEXnet_11.19.2 for FlexNet Version 11.19.2 for Ubuntu.

Changes required in machind

  1. /<FLEXnet_install_dir>/machind/lm_code.h - We must set the vendor and TRL keys assigned to us by Flexera, the seed keys, the encryption strength, and the daemon name.
    1. Set VENDOR_KEY1, VENDOR_KEY2, VENDOR_KEY3, VENDOR_KEY4, and VENDOR_KEY5 to the values provided by Flexera.
    2. Set VENDOR_NAME to "ddciflex".
    3. Set LM_SEED1, LM_SEED2, and LM_SEED3 to DDC-I, Inc.'s super secret values. These must never change!
    4. Set LM_STRENGTH to LM_STRENGTH_163BIT.
    5. Set TRL_KEY1 and TRL_KEY2 to the values provided by Flexera.
  2. <FLEXnet_install_dir>/machind/lsvendor.c - We want to enable the early return of borrowed licenses.
    1. Locate the definition of "ls_borrow_return_early". Set to 1.
    2. Locate the definition of "ls_allow_updated_feature_borrow". Set to 1.

Changes required in x64_lsb

  1. <FLEXnet_install_dir>/x64_lsb/makefile - We must name the daemon and tweak for backward compatibility. For 11.9.2 the dir is x64_n6 (not x64_lsb)
    1. Set DAEMON to ddciflex. For 11.9.2 the VENDORNAME must be changed
    2. Change all occurrences of "_trl" to "" (minus the quotes.)
    3. Add -no-pie to the front of the LDFLAGS list.
  2. <FLEXnet_install_dir>/x64_lsb/makefile.act - We must name the daemon and tweak for backward compatibility.
    1. Set DAEMON to ddciflex.
    2. Change all occurrences of "_trl" to "" (minus the quotes).
    3. Add -no-pie to the front of the LDFLAGS list.

Copy and update build scripts and dockerfile

  1. Copy build.sh, build_all.sh and flexnet-11_15_1.dockerfile from DDCI_Flexnet_11.15.1_ubuntu to DDCI_FLEXnet_11.19.2_ubuntu
  2. Rename flexnet-11_15_1.dockerfile to flexnet-11_19_2.dockerfile
  3. In build.sh, update the version in lines 14 & 15 (checkout_11_19_2_feature and FLEXnet_11.19.2)
  4. In build.sh, update the version
  5. In build_all.sh, replace 11.15.1 with 11.19.2
  6. In build_all.sh, update the version
  7. Copy build.sh from DDCI_Flexnet_11.15.1_ubuntu/FLEXnet_11.15.1/x64_lsb to DDCI_FLEXnet_11.19.2_ubuntu/FLEXnet_11.19.2/x64_lsb

CheckoutFeature required file changes

  1. Copy build.sh, checkoutFeature.cpp, Makefile and stdafx.h from DDCI_Flexnet\DDCI_Flexnet_11.15.1_ubuntu\CheckoutFeature
  2. In Makefile, replace Flexnet_11.15.1 with Flexnet_11.19.2
  3. In Makefile, replace 11_15_1 with 11_19_2

DeosIntegSO required file changes

  1. Copy build.sh, ddcix11.cpp, ddcix11.version, license_common.h, Makefile, stdfax.h, test.c from DDCI_Flexnet\DDCI_Flexnet_11.15.1_ubuntu\DeosIntegSO
  2. In Makefile, replace 11.15.1 with 11.19.2

javaflexlic required file changes

  1. Copy build.sh, com_ddci_common_ide_licensing_DdciLicense.c, com_ddci_common_ide_licensing_DdciLicense.h, flexnet_so.cpp, JavaUtil.version, JavaUtil_so.mak, license_common.h from DDCI_Flexnet\DDCI_Flexnet_11.15.1_ubuntu\javaflexlic
  2. In JavaUtil_so.mak, replace 11.15.1 with 11.19.2

Check in downloaded and updated files to SVN

In DDCI_FLEXnet_11.19.2_ubuntu, issue the following two find commands to set the executable permissions correctly on all the files:

 for f in $(find . -type f -perm -o+x); do svn ps svn:executable true $f; done
 for f in $(find . -type f); do if file $f | grep -E 'executable|interpreter' > /dev/null; then svn ps svn:executable true $f; fi; done

The two find commands ensure the executable properties for the files are correct, and help avoid problems with building.

For each of the directories: DDCI_FLEXnet_11.19.2_ubuntu, CheckoutFeature, DeosIntegSO and javaflexlic:
Use the following svn commands to check in the files.

 svn add --no-ignore *
 svn -R propset DDCI:pcr-required true *
 

The --no-ignore is important on the svn add to ensure that all .o files delivered by Revenera are checked in.
Then check in the files using the appropriate PCR and a comment (e.g.):

 svn ci -m"PCR 4642. adding files downloaded and updated" *


Build Everything

Building FLEXnet_<version> (11.19.2 and higher)

The following commands construct the Docker image. They should work from either Cygwin or a Linux host:

   Login to to docker using the instructions here:
   https://deos.ddci.com/scm/Deos/maintainer-tools/docker/branches/mainline/README.txt
   cd ~
   svn co https://deos.ddci.com/svn/DDCI/products/DDCI_Flexnet/DDCI_FLEXnet_11.19.2_ubuntu/
   cd DDCI_FLEXnet_11.19.2_ubuntu
   proxy_args="--network=host --build-arg http_proxy=http://localhost:3142"  # Only if apt-cacher is running
   docker build  -t flexnet-11_19_2 $proxy_args - < flexnet-11_19_2.dockerfile
   
   thisDir=$(pwd)
   thisDir=$(cygpath -wa $thisDir)   # Only if running on windows
   # The the following command starts a docker container (both windows and Linux):
   docker run --rm -it -v "$thisDir":/root/DDCI_Flexnet_11.19.2_ubuntu -v /mnt:/mnt --workdir /root/DDCI_Flexnet_11.19.2_ubuntu/ flexnet-11_19_2

At the Ubuntu command prompt, enter:

   ./build_all.sh

To clean:

   build_all.sh clean

Follow the instructions from build_all.sh to publish the resulting flexnet-linux-*.tar.bz2 file to the deosftp server.

OpenArbor needs the content of flexnet-lunx-*.tar.bz2 installed in the docker image in order to provide support for license borrowing. The flexnet-lunx-*.tar.bz2 file contains the lmborrow, lmutil, checkout_11_19_2_feature and a symbolic link from lib64/ld-lsb-x86-64.so.3 -> ld-linux-x86-64.so.2. The symbolic link from lib64/ld-lsb-x86-64.so.3 -> ld-linux-x86-64.so.2 is required to allow lmborrow to run in our docker image. The FLEXnet build environment requires ld-lsb-x86-64.so.3 which is not currently installed in our docker environment. Installing lsb would add printer drivers, etc that we do not want in our docker image. So this symbolic link was added as a work-around.

The following component specific instruction describe how to use the other build artifacts.

Details for building individual components

The following are only needed during development or if build_all.sh above fails.

Flexnet proper

The FLEXnet directories each contain the installed FLEXnet versions and their supporting libraries and executables. Each one contains an "x64_lsb", and "machind" directory where a small set of files has been updated to produce a DDCI specific version of flexnet. This is documented above. Currently, DDC-I distributes the 11.19.2 version of the ddciflex 64-bit daemon, and it's supporting executables.

javaflexlic Directories

   cd /root/DDCI_Flexnet_11.19.2_ubuntu/FLEXnet_11.19.2/x64_lsb/
   ./build.sh

The following list of files are distributed by DDC-I: (pic is from an installation of FLEXnet 11.19.2)

javaflexlic Directories

The javaflexlic directory contains the source, makefile, and build script to build JavaUtil.so using FLEXnet 11.19.2 for 64-bit, used by the OpenArbor to checkout licenses. When successfully built, the Release directory will contain a so called JavaUtil.so that is released via the com.ddci.common.ide/lib directory of OpenArbor.

To build the JavaUtil.so for 64-bit, several things are required: 1) The build environment created by the Docker file above which includes openjdk-11-jdk (11.0.9), 2) FlexNet 11.19.2 must have already been built.

To Build (64-bit):

   cd /root/DDCI_Flexnet_11.19.2_ubuntu/javaflexlic
   ./build.sh

To clean:

   build.sh clean

CheckoutFeature Directories

The CheckoutFeature directories contains the source, makefile, and build script for building the checkout_<FlexNet_Version>_feature program, that is used by OpenArbor to check out license features for license borrowing (see DDCI_PCR:2050 for more details). When successfully built, the Release directory will contain an executable called checkout_<FlexNet_Version>_feature that must be copied to <TBD>\\nx3000\openarbor\Downloads\BuildResources</TBD> to be properly built into an OpenArbor release.

To build the checkout_<FlexNet_Version>_feature for 64-bit, the following required: 1) The Docker environment detailed above. 2) FlexNet 11.19.2 must have already been built.

To Build (64-bit):

   cd /root/DDCI_Flexnet_11.19.2_ubuntu/CheckoutFeature
   ./build.sh all

To clean up:

   build clean

DeosIntegSO Directory

The DeosIntegSO directory contains the source, Makefile, and build script for building the ddcix11.so with FLEXnet 11.19.2, used by the Deos IT tool to checkout licenses. When successfully built, the Release directory will contain a shared library called ddcix11.so that the Deos IT team uses in it's build process (contact GK).

To build the ddcix11.so for 64-bit, several things are required: 1) The build environment created by the Docker file above, 2) FlexNet 11.19.2 must have already been built.

To Build (64-bit):

   cd /root/DDCI_Flexnet_11.19.2_ubuntu/DeosIntegSO
   ./build.sh

To clean:

   build.sh clean

Release Everything

Releasing the Server

Use the scp command to upload the zip file on the ftpserver.

 ssh deosftp@deos.ddci.com -p 47734
 ./disableBuild.sh <initials>
 cd pub
 cd flexnet-products
 cd flexnet-server
 mkdir 4.0

From another terminal:

 scp -P 47734 ./flexnet-server-linux-4.0.tar.bz2 deosftp@redhat5.ddci.com:/ftp/pub/flexnet-products/flexnet-server/4.0/

Then in original terminal, update the unreleased link to point to the new dir (4.0):

 rm unreleased
 ln -s 4.0 unreleased
 cd /ftp
 cd deos2cygwin
 ./deos2cygwin.py

Releasing OpenArbor flexnet files

Modify the build.sh script to specify the correct path for copying lmborrow and lmstat
Run the build.sh script to create flexnet-linx-4.0.zip
Use the scp command to upload the zip file on the ftpserver.

 ssh deosftp@deos.ddci.com -p 47734
 ./disableBuild.sh <initials>
 cd pub
 cd openarbor-products
 cd flexnet
 mkdir 4.0

From another terminal:

 scp -P 47734 ./flexnet-linux-4.0.tar.bz2 deosftp@redhat5.ddci.com:/ftp/pub/openarbor-products/flexnet/4.0/

Then in original terminal, update the unreleased link to point to the new dir (4.0):

 rm unreleased
 ln -s 4.0 unreleased
 cd /ftp
 cd deos2cygwin
 ./deos2cygwin.py

Releasing the Test Harness flexnet files

Run the build_for_test_harness.sh script to create flexnet-test-harness-linux-11.19.2.tar.bz
Check in resulting file to https://deos.ddci.com/svn/DDCI/products/openarbor/utils/dds-manager/dds-manager-e4/com.ddci.dds.manager/FLEXnet/64-bit/linux/
Update https://deos.ddci.com/svn/DDCI/products/openarbor/utils/dds-manager/dds-manager-e4/Makefile to use updated flexnet tar file


Releasing the License Generator flexnet files

The License Generator uses two files built for FLEXnet: lmutil and lmcrypt

  1. modify LicenseGenerator\mainline\version.txt to increment the version number
  2. copy DDCI_Flexnet\DDCI_FLEXnet_11.19.2_ubuntu\FLEXnet_11.19.2\x64_lsb\lmcrypt to LicenseGenerator\mainline\linux_files\lmcrypt_11_19_2
  3. copy DDCI_Flexnet\DDCI_FLEXnet_11.19.2_ubuntu\FLEXnet_11.19.2\x64_lsb\lmutil to \LicenseGenerator\mainline\linux_files\lmutil
  4. modify LicenseGenerator\mainline\Makefile to install the new files
  5. modify LicenseGenerator\mainline\src\com\ddci\licenseGenerator\LicenseGenerator.java to update the signAllThisStuff function to use the new version of lmcrypt when signing a license file.

Follow the instructions here Flexnet_License_Generator to checkout, build, run and deploy the updated License Generator.

Creating a Docker Image

In /ftp/pub, there is a flexnet-products/flexnet-server directory containing the versions of the flexnet-server-linux-n.n.tar.bz2 file for distribution to customers.
On ddsbuild, issue the following command to build a docker image containing what is needed to start, stop and managed a license server on Linux.
In the docker image, the FLEXnet files are installed in /usr/bin.

Creating an Image with Unreleased Components

If the flexnet-server package is unreleased, create the flexnet-server-linux-n.n.tar.bz2 file for testing prior to releasing to customers by using the bdu script.

  1. Start the populateDDS64bit terminal
  2. cd /cydrive/c/DDCI_integration/DDS/docker
  3. ./bdu --save=ddci-flexnet-server-linux-$(date +%Y%m%d) jupiter flexnet-server

The resulting flexnet-server-linux-n.n.tar.bz2 can then be manually copied to a docker DDS folder that has already been created.

Creating a Stable Image

Once the flexnet-server package is marked stable, create the flexnet-server-linux-n.n.tar.bz2 file for distribution to customers and update the populateDDS.py script to use it when building docker DDSes.

  1. Login to ddsbuild as scoretest
  2. Start the populateDDS64bit terminal
  3. cd /cydrive/c/DDCI_integration/DDS
  4. ./docker/build-docker --save=ddci-flexnet-server-linux-$(date +%Y%m%d) jupiter flexnet-server
  5. Update populateDDS.py to point to the new version of the server linux tar.gz file

Installing the Docker Image

The populateDDS.py script is updated to include the license server docker image and a script to aid users in starting the license server using the license file provided by DDC-I.

  1. ./install-ddci-flexnet-license-server license.lic licenseFile [logFile]

Releasing License Server to the Upload Site

Place the license server files here: https://deos.ddci.com/upload, Username=liclin password=Vm8q6VJQ.

  • ddci-flexnet-server-linux-20220712.tar.gz
  • dds_install_linux.html
  • fnp_licAdmin.pdf
  • install-ddci-flexnet-license-server