Troubleshooting
Problem
Why does "bsub -I logname" generates an error message : logname: no login name?
Resolving The Problem
Why does "bsub -I logname" generates an error message : logname: no login name?The trouble is that after the logname job being dispatched to a host to run, it loses the controlling terminal information, so that getlogin() cannot get the login name.
There are two solutions:
1. Refer to $LOGIN environment variable instead of using logname command. For example, use bsub -q term -I "echo $LOGNAME" to query the login name.
2. Use the following C program to query the user name as a replacement of logname command:
#include int main(void)
#include
{
struct passwd *pwd;
pwd = getpwuid(geteuid());
printf("%s\n", pwd->pw_name);
return (0);
}
Was this topic helpful?
Document Information
Modified date:
23 June 2018
UID
isg3T1013974