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

3

7

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?

Breastfeed answered 21/12, 2012 at 15:32 Comment(0)
B
4

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
Ballista answered 21/12, 2012 at 23:15 Comment(1)
This gave me the hint I needed, thanks. I just echo'd my LSF related environmental variables and then had them export set in the script before calling the jobs.Flycatcher
N
0

For anybody scripting around SSH, the two variables above must be explicitly set, either on the command line, as in:

ssh [email protected] 'export LSF_ENVDIR=/path/to/lsf/envdir; export LSF_SERVERDIR=/path/to/lsf/serverdir; bsub ...'

or in the file ~/.ssh/environment file (provided that sshd is configured with PermitUserEnvironment yes).

Narra answered 24/10, 2013 at 12:58 Comment(0)
J
0

Test environment: IBM Spectrum LSF 10.1.0.0 build 476021, Nov 20 2017 under "Red Hat Enterprise Linux Server 7.9 (Maipo)". Execute the following command first:

For csh or tcsh:   
source /lsf_installed_dir/path_to/cshrc.lsf

For sh, ksh, or bash:   
. /lsf_installed_dir/path_to/profile.lsf

Then execute bjobs command, for example, bjobs -V. The error message something like,

lsb_init: initenv_:fopen(/etc/lsf.conf) failed, No such file or directory.
lsb_init: Failed in an LSF library call: Unable to open file lsf.conf

no longer displayed.

Jerrelljerri answered 15/9, 2023 at 20:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.