Macs in Chemistry

Insanely great science


Start lmgrd license server

I use Moe for molecular modeling work, this uses a license.dat file in each installed MOE root directory that must be updated with the contents that you have been given by CCG (either by hard copy or e-mail). You can use any ASCII text editor (I used BBEdit) to edit the file. The FlexLM license manager lmgrd must be configured and run. Usually this runs quietly in the background and needs little intervention, however I've found that on some occasions the server quits (perhaps after updates) and needs to be restarted. However since it is something I don't need to do regularly I always spend a while working out the exact syntax. So I created this short Applescript to restart the server.

set the_script to " /Applications/moe/bin-mppc/lmgrd -c /Applications/moe/license.dat -l /Applications/moe/license.log"

tell application "Terminal"

do script the_script

end tell


Each time MOE gets updated you need to change the folder path, so as of the latest version it becomes

set the_script to " /Applications/moe2012/bin-mppc/lmgrd -c /Applications/moe2012/license.dat -l /Applications/moe2012/license.log"

Whilst you could put the applescript anywhere I use the script menu, if you don't have this running go to the Applescript Editor preferences. You should get the dialog shown below, check the box "Show Script menu in menu bar", and the applescript icon should appear in the top right group of menu bar icons.


You can now save the script to Username:Library:Scripts, naming it as "start license server". You can create subfolders in the "Scripts" folder in order to organise all your scripts. If you now click on the applescript icon in the upper right menu bar, you should get a dropdown menu listing all the applescripts. Scripts that are available to all users are in Macintosh HD:Library:Scripts.

For more information on Applescript have a look at the Applescript Resources Page.