X
3023

[Archive] Starting the FLEXlm license manager at boot time on Mac OS X

Topic:
The Discussion section below shows the steps necessary to have the FLEXlm license manager start at boot time on Mac OS X in IDL versions 5.6 and 6.0.


IMPORTANT NOTE FOR 6.1 USERS: Starting with IDL 6.1, the GUI installer for RSI products has a boot script installer that automatically writes files like those described below into a directory path 'Library/StartupItems/IDL_LMGRD/'.

If the IDL installer failed to create this directory and its contents, you could alternatively execute the following commands when you have root privileges. For example, if IDL 6.1 is installed at /Applications/rsi/idl_6.1 then issue the commands:
    cd /Applications/rsi/idl_6.1/bin
    sudo ./lmgrd_install

Whether the license manager installer was run automatically or launched manually, if you already have in '/Library/StartupItems/' a different-named directory for this, like the "RSI_LICENSE" directory described below, then you should delete this directory with:

    sudo rm -r /Library/StartupItems/RSI_LICENSE

after the '/Library/StartupItems/IDL_LMGRD/' directory is installed.

IDL 5.6 and IDL 6.0 do not have any automated way of creating the Mac OS X boot scripts, so users who have still not upgraded should follow the instructions below (as should 6.1 users who are having troubles with our automated install).


Discussion:
Below are steps that we recommend for setting up the RSI/FLEXlm license management service to start at boot time. Note that these steps assume that the '/idl/' directory (or, should we say, the directory pointed to by softlink 'idl'), was installed in the default path '/usr/local/rsi/'. You will need to edit the below, if your '/idl/' directory is in a different location.


Step 1: Make sure that 'root' has a password on your host. If it is not set, or you are not sure whether it is, enter the below command at your prompt and follow its prompts:

      sudo passwd root

Without this command the 'su' command used below will fail. Make sure you remember the very important password that you assign.


Step 2: Make a startup directory specific for the IDL licensing routine. The first line below will be needed, if you do not already have a 'StartupItems' folder in your '/Library' directory:

      sudo mkdir /Library/StartupItems
      sudo mkdir /Library/StartupItems/RSI_LICENSE


Step 3: In the editor of your choice create in the above directory a C-Shell script file named "RSI_LICENSE".


Step 4: Below is the text that should appear in the new 'RSI_LICENSE' file. This link - Download RSI_LICENSE - will give you a copy of this script, with all the Tech Tip's instructions in the comments. Note that you need to change the user name shown after 'su'.
    #!/bin/sh

    . /etc/rc.common

    StartService()
    {
    ConsoleMessage "Starting FLEXlm RSI License Manager"
    su johndoe -cf "/usr/local/rsi/idl/bin/lmgrd \
    -c /usr/local/rsi/license/license.dat \
    >> /usr/local/rsi/license/lmgrd.log"
    }

    StopService()
    {
    ConsoleMessage "Stopping FLEXlm RSI License Manager"
    /usr/local/rsi/idl/bin/lmdown -c \
    /usr/local/rsi/license/license.dat \
    >> /usr/local/rsi/license/lmgrd.log
    }

    RestartService()
    {
    ConsoleMessage "Restarting FLEXlm RSI License Manager"
    StopService
    StartService
    }

    RunService "$1"

(Note: Some users report problems with the "su johndoe -cf ..." syntax in StartService(). If your implementation of the above is persistently not working, you can troubleshoot by simplifying that command down to "/usr/local/rsi/idl/bin/lmgrd -c /usr/local/rsi/license/license.dat", which abandons keeping a log of all license activity and which allows the license manager daemon to run as a process owned by "root".)

Step 5: Note that the last line in the above will set the output log for the license manager daemon to a file in '/usr/local/rsi/license/'. Make sure to change permissions in that directory to 777 (R-W-X all). The syntax for this is:

      sudo chmod 777 /usr/local/rsi/license


Step 6: Make another file for the new 'RSI_LICENSE' directory named "StartupParameters.plist" with the text shown below. This link - Download StartupParameters.plist - will give you a copy of this short script.

    {
    Description = "RSI/IDL's License Manager Service";
    Provides = ("RSI_LICENSE");
    Requires = ("Network", "Resolver");
    OrderPreference = "Late";
    }

Step 7: Important! Set the permissions on the two new files above to 755 (R-X all) using the following commands:

sudo chmod 755 /Library/StartupItems/RSI_LICENSE/RSI_LICENSE
sudo chmod 755 /Library/StartupItems/RSI_LICENSE/StartupParameters.plist


You can test that the above procedure works on your machine with the following steps:

  1. Reboot.

  2. Try to run the command 'idl' from the very first 'X11' Xterm that you open up. (Note: If you have not yet sourced 'idl_setup' in your .cshrc file, run '/usr/local/rsi/idl_6.0/bin/idl' instead.)

If 'idl' runs licensed, then you know that the 'lmgrd' is starting up correctly at boot time. If the 'idl' command complains that "Server is not yet started", then contact us at support@ittvis.com with details on the failure.

We have found the following link:

   http://www.osxfaq.com/Tutorials/LearningCenter/HowTo/Startup/index.ws

to be particularly useful on this subject. You might find other alternative methods there, if the above steps are not working for you. This link also has a good discussion on the subject of network security of boot processes.Solution:
[Edit this field in the IDL-based Tech Tip Editor, v60]