This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Manickaraja Kumarappan
Recipients Manickaraja Kumarappan
Date 2020-05-29.20:31:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590784290.42.0.113469889536.issue40821@roundup.psfhosted.org>
In-reply-to
Content
Hi,
We are using below command to get the original login user. In some cases folks sudo as different user and run commands. In some cases folks use switch to different user (su - <>) and then run command. In all cases we would like to get original user who logged into the terminal to run the command. We are using below command to get the same.

user=os.getlogin()

We got three RHEL linux systems with Python 3 and strangely on two of them this command works fine. However only on third system it is failing with below error

OSError: [Errno 6] No such device or address

Not sure if it is some o/s env setup which is causing this command to fail. Any pointers to run this command will be of great help so that we can pin point the issue.

Please note on faiing system if I do python and then run the command it works fine without any issue. However if it is triggered through our Scheduler (Control M) it is failing with above message.

Give below is the command how Scheduler triggers the job.

/bin/su - edwadm -c /bin/sh -x <>

Thanks
Manick.
History
Date User Action Args
2020-05-29 20:31:30Manickaraja Kumarappansetrecipients: + Manickaraja Kumarappan
2020-05-29 20:31:30Manickaraja Kumarappansetmessageid: <1590784290.42.0.113469889536.issue40821@roundup.psfhosted.org>
2020-05-29 20:31:30Manickaraja Kumarappanlinkissue40821 messages
2020-05-29 20:31:29Manickaraja Kumarappancreate