You are not logged in.
Pages: 1
I'm trying to use openvt to switch to another vt and execute a command but I always get the error:
Couldn't get a file descriptor referring to the consoleIf I try with sudo I don't get any error but also nothing happens.
I tested with shvt too and I get the same error. Do I need to do something else for those programs to work?
Offline
If I try with sudo I don't get any error but also nothing happens.
1. what's the exact command
2. are you sure? Did you try to switch to the TTY?
3. "man openvt", "-s" ?
Offline
1. The one used as example in man examples:
openvt -- ls
2. yes I tried but I just get the usual tty login prompt
3. No I didn't try that. I tried only to specify the tty number and I was manually switching. I just tried with "-s" and this works! Need to run the command with sudo though. It doesn't work with normal user rights? In all examples and info I found there was no mention that need to have root rights.
EDIT:
Though the command starts with "-s" parameter, I cannot interact with the shell after switching.
Last edited by zaxdan69 (2023-10-31 16:11:31)
Offline
You need permissions on the relevat dev/tty - regardless how (either by changing owner/group/permissions or through ACLs or w/ sudo or suid on openvt)
What exact command do you try that leads to "I cannot interact with the shell after switching." and if it's "ls", how do you want to interact w/ that?
The entire thing smells like an https://en.wikipedia.org/wiki/XY_problem - what is your ulimtate goal here?
Offline
I found the problem with the interaction(by this I meant to be able to use the command line after the command run). The problem was the "--" and witout them I can input commands after.
You have right, about the problem in the link. I was thinking about it too and I was intented to give more info, but because I also try to fix it myself and search more about the openvt I didn't do it yet.
So, this is what I plan to do. I have a script which is interactive and start a standalone application after user's selection. Mostly I want to use it for start some game managers like steam, heroic, lutris and maybe some other apps. What I want to do, is instead of to manually switch to the tty, login and start the script, to do it automatically.
Last edited by zaxdan69 (2023-10-31 19:01:30)
Offline
Pages: 1