Search code examples
centoslsf

Error with LSF Platform: lsb_init: Failed in an LSF library call: Unable to open file lsf.conf


I have an issue with LSF Platform I cannot wrap my head around.

For scripting reason, I need to check the running/pending jobs with 'bjobs' (and other b***) with a perl script.

For some reason it did not work, and I was able to view the following error message:

lsb_init: Failed in an LSF library call: Unable to open file lsf.conf

Some research on Google and in the manual gave nothing great, I did a little test.

My account (max) is a LSF administrator. Root is a LSF admin as well.

So I switched to root, and tried to launch bjobs, but being max with 'sudo –u max'. Please have a look at these commands:

hn[~]=> whoami
max
hn[~]=> bjobs
No unfinished job found
hn[~]=> su
Password: 
[root@hn max]# whoami
root
[root@hn max]# sudo -u max whoami
max
[root@hn max]# bjobs
No unfinished job found
[root@hn max]# sudo -u max bjobs
lsb_init: Failed in an LSF library call: Unable to open file lsf.conf

How can I correct this?


Solution

  • By default LSF will look for lsf.conf in /etc. If its not there, then it will look in the directory in the env variable LSF_ENVDIR.

    sudo is probably resetting your environment. Try sudo -i or put

    Defaults !env_reset
    

    in your sudoers file.

    You could also try something like this

    sudo -u max LSF_ENVDIR=$LSF_ENVDIR LSF_SERVERDIR=$LSF_SERVERDIR bjobs