V
V
Vitaly2018-05-14 11:48:54
linux
Vitaly, 2018-05-14 11:48:54

How to start script execution from one tty in another?

All the best!
I have a script on the node that I run:
node /pathtoscript/index.js 2>&1 > /dev/tty6 &
In it, at a certain moment, the command line command is executed:

exec(DISPLAY=:0 firefox -p "default" http://google.com)

And the fact is that if you run the script in the current tty (that is, just node /pathtoscript/index.js WITHOUT 2>&1 > /dev/tty6 & ) - then everything works, but if it is described above, then no.
How do I get firefox to run in my work tty ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
ivankomolin, 2018-05-17
@ivankomolin

If I understand correctly, you want to send the result of the index.js script execution to the /dev/tty6 virtual console, and send the exec result that is executed during the script to the current console.
Here are the options:
1. Pass the result of the exec to /dev/tty0 or /dev/console (i.e. to the current active console)
2. At the time of running the index.js script, pass the value of the current console inside, this is /dev/tty (if you run the script yourself) and send the result of exec there.
But there is some strange task before you, if I understood everything correctly)

S
Stanislav Vlasov, 2018-05-22
@Stanislavvv

I suspect that the problems here are not in tty, but in access to $ DISPLAY
On this occasion, I can only advise reading about xauth and the XAUTHORITY environment variable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question