问题
If I have a (compiled) background process (on GNU/Linux) such as a daemon create a pseudo-tty for itself, using openpty() or similar, is there a way to connect to it from the shell, for example to open a command line oriented interface (e.g. for debugging / re-configuring it on the fly).
This is very similar to what is asked here:
How to create pty that is connectable by Screen app in Linux
Someone suggests an answer where they connect to it using screen and minicom but it is not that clear to me how. I had assumed screen could only connect to screens created by screen.
Ideally I want to either use standard command line tools to connect to the daemon or provide a lightweight program that does the necessary.
The aim is for something simpler than going for a full scale client server implementation (and to play with ttys).
This is a cut-down version of attach a terminal to a process running as a daemon (to run an ncurses UI) which is a bit more vague.
来源:https://stackoverflow.com/questions/65152924/is-there-a-way-to-connect-a-shell-to-a-pseudo-tty