Problem:

Errors such as "corrupt license database" are occurring, and prior efforts to fix them have failed.

Resolution:

Here is a thorough and comprehensive way of recovering from "corrupt license database" errors if other efforts have failed, for example if the "lmfdbrecover" or "aslmdbrecover" utilities don't exist or didn't work for some reason.  This requires root credentials.  Also, you must have your licenses available at hand (including, for each license, both the serial number and the license key) because during this process you re-install the licenses.

1. Login with root credentials

2. Change directories (cd) to the directory where the COBOL product is installed.  This is by default /opt/microfocus/cobol, but the person originally installing may have specified any location.  It is possible that more than one COBOL product is installed on a given machine.  If you do not know the location (or the locations) where COBOL is installed, use this command:

 find / -name cobver -print -exec cat {} \\; -exec echo \\; -o -fstype nfs -prune 2>/dev/null

which may take awhile because it searches the entire machine. 

If this reveals more than one COBOL installation, see the following article to tell the difference between them:

http://community.microfocus.com/microfocus/cobol/net_express__server_express/w/knowledge_base/1496.how-do-i-know-which-product-i-currently-have-set-up.aspx

3. cd to your most recent and modern COBDIR.  If you have a Server Express installation, i.e. one where the PRN begins with "RX", cd to it (if not, cd to the most recent COBDIR with a PRN beginning with "R1").   For example, by default:

 cd /opt/microfocus/cobol

then cd to the "aslmf" subdirectory:

 cd aslmf

4. Invoke the 'apptrack' runtime license utility:

 ./apptrack

5. If the apptrack menu appears, then the runtime license database is not corrupt and does not need to be re-installed.  Press 6 to "Reinitialize Licensing", then press 9 to quit apptrack, then skip to step 11 of these instructions.

6. At this point, since the apptrack menu did not appear in the previous step, we assume the runtime license database is corrupt.  cd to /var:

 cd /var

7. Delete the directory named mfaslmf using this command:

 rm -rf mfaslmf

8. cd back to where COBOL is installed (a.k.a. COBDIR)

9. Notice the existence of the 'aslmf' subdirectory, but don't cd to it.

10. Enter the command

 aslmf/aslmfinstall

From your position in COBDIR, this invokes the command aslmfinstall that exists within the aslmf subdirectory.  It must be invoked this way, "from one directory up".  It will complete with no messages, indicating success.

11. If the "development" product, named "Server Express", is installed on the machine (as opposed to just the "runtime" product known as "Server for COBOL"), then locate the operative LMF directory according to the following directions. However, if only the "runtime" product is installed, skip to step 26.

To locate the operative LMF directory, invoke the command "lmfgetpv" that exists in $COBDIR/lmf.  For example, from your position in COBDIR, enter:

lmf/lmfgetpv

If the License Manager is running, lmfgetpv will produce output similar to:

License Manager version 129
Loaded from /opt/microfocus/mflmf

The "Loaded from" location is the operative LMF directory.  In the above example, "/opt/microfocus/mflmf" was discovered to be the operative LMF directory.

If the License Manager is running, and you see output such as the above, then the LMF database is not corrupt, and does not need to be re-installed.  Skip to step 25.

If the License Manager is not running, lmfgetpv will report:

License Manager is not running

In that case, a way of discovering the operative LMF directory is by entering the following command:

grep  COBDIR=  /etc/mflmrcscript

The COBDIR returned from this 'grep' command is the operative LMF directory configured for automatic start at boot time. Note: in this context, COBDIR indicates the operative LMF directory; in this context it does not have its usual meaning of indicating the location where Server Express is installed.

12. cd to the operative LMF directory discovered in the previous step.

13. Type the following command to shut down the License Manager:

 ./lmfgetpv k

14. cd up one directory (to the parent directory), for example:

 cd ..

15. Delete the entire operative LMF directory using the command 'rm -rf', specifying the directory name.  As an example, if the opertative LMF directory was /opt/microfocus/mflmf, and you are now positioned at /opt/microfocus, then enter:

 rm -rf mflmf

16. cd to where COBOL is installed, a.k.a. COBDIR

17. cd to the subdirectory named lmf:

 cd lmf

18. Invoke the 'lmfinstall' script:

 sh ./lmfinstall

19. When it asks for a location, enter the full path to the former operative LMF directory (the one you just deleted), so it will be re-installed at its former location

20. When it asks the question "only superuser", answer "n" for "no". It is safe to do so; it would still require superuser to modify licensing, this will just allow other users to see what licenses are installed

21. Answer "yes" to the question "autostart at boot time".

22. Now that the lmfinstall script is done, cd to the location you just specified, i.e. the operative LMF directory

23. Start the license manager using the mflmman command:

 ./mflmman

24. Install your "development" a.k.a. "Server Express" licenses using the 'mflmcmd' command.  Enter:

 ./mflmcmd

and follow the prompts.  If you have more than one such license to install, repeat this step until they are all installed.

25. Enter the 'devas' command to make sure Developer Usage runtime licenses are installed in apptrack:

 ./devas

26. cd to where COBOL is installed, a.k.a. COBDIR

27. cd to the subdirectory named aslmf:

 cd aslmf

28. Use the apptrack command to install your "runtime" licenses a.k.a. "Server for COBOL" licenses:

 ./apptrack

29. Both licensing systems should now be fixed; test the operation of COBOL according to the directions in the following article:

http://community.microfocus.com/microfocus/cobol/net_express__server_express/w/knowledge_base/1589.what-is-a-quick-way-to-test-whether-server-express-can-compile-and-run.aspx