-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using -N argument with a terminal multiplexer in a TTY-less environment #11
Comments
I just tried this:
It creates a shell and waits. The dtach process is not associated with any terminal, has it's stdio pointing at
So ... works for me. Any more details? Traces, errors? |
Huh. I thought I'd managed to rule out the issue being in the script I was running, but apparently not. I can reproduce it if I have |
Humm, |
Right; I forgot about |
this is also a problem when running dtach under a systemd session and drove me up the walll... I found this discussion: https://stackoverflow.com/questions/34808956/dtach-in-systemd-service-file ... which seem to say that ... which makes no sense to me: the whole point of this thing is to have no terminal available in the first place. it would be great if this could be started without any TTY. |
actually, nevermind - i was able to run this simply by adding TERM:
|
While playing with
dtach
in a Docker container, I found thatdtach -N <some socket> <some command>
seems to exit silently when it's invoked in an environment which has no terminal (which is Docker's default) but works fine if I make Docker allocate a terminal. That would make sense for the-c
mode, but I'd imagine that-N
could theoretically work just fine whendtach
is started in a "terminal-less" environment since it creates its own PTY for the command and never attaches to it. Is this just a side effect of howdtach
currently handles terminals, or is there a fundamental limitation in the Linux APIs that would preventdtach
from functioning correctly in a terminal-less environment without daemonizing?It's an easy enough fix in my own project to just allocate a terminal, but I figured I'd mention it in case you thought it was worth looking at eventually.
The text was updated successfully, but these errors were encountered: