I have a customized login button on Alma Linux VM, on pressing enter key it will call calls a python script, which internally call ‘/usr/bin/login’ command.
At below code, it gets stuck and login prompt is not seen.
subprocess.call([‘/usr/bin/login’])
I tried using… subprocess.call([''exec, ‘/usr/bin/login’]) in script it throws error…
Traceback (most recent call last):
File “/opt/test/scripts/./uag_login”, line 114, in
main()
File “//opt/test/scripts/./uag_login”, line 111, in main
curses.wrapper(login_screen)
File “/usr/lib64/python3.9/curses/init.py”, line 94, in wrapper
return func(stdscr, *args, **kwds)
File “/opt/test/scripts/./uag_login”, line 76, in login_screen
subprocess.call([‘exec’, ‘/usr/bin/login’])
File “/usr/lib64/python3.9/subprocess.py”, line 349, in call
with Popen(*popenargs, **kwargs) as p:
File “/usr/lib64/python3.9/subprocess.py”, line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “/usr/lib64/python3.9/subprocess.py”, line 1837, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘exec’
Note : when i run ‘login’ or ‘exec login’ command manually it works, the issue is seen only when these commands are executed through python scripts.