Friday, December 11, 2009

tricks and treats..

Here are a few 'postit' type notes that will come in handy. I will keep adding to this list whenever I catch a fish or two to add :

NMRSim installation
  • When you install TS1.3 or TS2.1 in a EL 5 or Fedora 10 like environment, you might get a complaint from NMRSim that it is not able to find : /usr/lib/X11/app-defaults.  Simply do this :
    • ln -sf /usr/share/X11/app-defaults /usr/lib/X11/app-defaults
  • Now reinstall NMRSim and the error will evaporate away.  
curdir and write permisssion :

  • Whenever you install a newer version of TS or XWIN, it often happens that the write permissions for the tree is changed en masse to a given user like nmrsu. It important that many of the directories need to have write access for all users for normal operation, on one hand, but a global write is a bad choice from security viewpoint, on the other.  You can create a separate group for all the NMR users involved and chgrp the tree to that special group and provide write permission for the tree and this is an acceptable solution. 
  • But, there is one directory, i.e. $TSHOME/prog/curdir/$nmruser, for which this does not work i.e. the respective nmruser needs to be the owner of this branch of the tree.  So, you must remember to chown the curdir/$nmruser to nmruser:nmruser for proper fucntioning of TS for that user's login. Also, don't forget the '-R' switch while you do this.
smoking out the port on which the CPRserver is running - the easy way..

  • Let me add that this tip is relevant when you are not  sitting at 'the spectrometer' console. If you are, simply enter hist on command line and find out the port number from there. But, if your spectrometer is in planet Mars and if you are at your desk, travelling back and fro is a bit trying.  That is where this tip becomes quite useful.
  • First of,  ssh into the remote host.
  • Then,
    • cd /opt/topspin/prog/curdir/current TS user
    • cat CPR.ref
  • The text output of CPR.ref will show a string such as :  corbaloc:iiop::5500/CPRMsg
  •  5500 is the port number on which the cpr server is running, according to the above output.
restarting the dataserver 
  • It might  happen that the data tree could not be opened sometimes (in the local TS session). If so, you can enter the command dataserver and this will launch another fresh dataserver thread. You can access the tree then on.
about remote connections 
  • If you are connecting to a remote TS server with a client, you have to make sure that the port into which you are connecting on the server is indeed the port at which the server is listening. To find this out, refer to the "smoking out the port on which the CPRserver is running" above.  If your remote connection is disabled from within Topspin on the remote server, you should enable the same by going to the Preferences - Misc - remote connections section.  You must restart Topspin on the remote server for your connection from a client to succeed.  

      to kill ...license

      Here is a simple trick that will come in handy for testing purposes.  It starts with the question :  will I be able to mimic a running Topspin host's configuration on a testbed machine so that I can install and run Topspin on this testbed without the need for a seperate license file i.e. by spoofing the testbed to be the original host in question.  The answer is yes and there are three important points to take care of :
      • You must copy over the license.dat of the TS host into the testbed to the relevant location. 
      • You must have a valid 'hostname' in the license.dat.  Since it is legal to chage this entry, you can set this to the testbed's hostname, specifically, to the name that is returned by `hostname` on the shell.
      • You change the MAC id of the NIC, usually eth0 to that of the TS host, like so: 
        • ifdown eth0
        • ifconfig hw ether AA:BB:CC:DD:EE:FF  (where the MAC Id typed is the same as that of TS host).
        • ifup eth0
        You might get an error message about the fact that the true MAC id and the spoofed one are different and the NIC may not come up at all.   Also, the MAC id spoofing is temporary and if you restart the network daemon, it reverts to the original.   For these two reasons at least,  this shortcut to inheriting an existing TS license is only a temporary indulgence.  But, this will come in quite handy to test run Topspin on the testbed, without imposing any down time on a running spectrometer.

      Ok, let us wrap up the protocol fully :
      • /etc/init.d/bruker_lmgr stop
      • /etc/init.d/brker_lmgr start
      • Now you can check under /usr/local/flexlm/Bruker/licenses, that the flexlm.log does show the daemon starting without any errors. 
      • If you start topspin now, you should be able to get to the interface without any errors. 
      As a closing thought, I will say this. In principle  you can exploit /etc/rc.local  to switch the MAC id after boot up and then restart lmgr to mimic the whole thing said above, in an automated fashion. But, since the NIC functionality is not expected to be smooth (as per my understanding thus far), this may not be a solution you look for on a permanent basis, anyway.