What's the difference between "-dm" and "-Dm" in GNU Screen?
0
votes
1
answer
204
views
The GNU Screen manual says:
`-d -m'
Start `screen' in _detached mode. This creates a new session
but doesn't attach to it. This is useful for system startup
scripts.
`-D -m'
This also starts `screen' in _detached_ mode, but doesn't fork
a new process. The command exits if the session terminates.
-dm
is pretty clear to me:
- screen
forks a new process to run the provided command (or a shell if nothing was specified).
- By "fork" it means that weird Schrödinger's system call in which the source code doesn't know if it's the parent or the child until the return value is observed.
- And this new process is recognized by screen
as something that can be attached.
I noticed that -dm
returns control of the shell, but -Dm
blocks.
So my question is:
- Why does -Dm
block? And how is that related to its lack of forking?
- What does it do instead of forking? I think it still creates a new process, because "detached mode" suggests a process identifiable by a PID which can be attached.
- What's the use case of -Dm
instead of -dm
?
Thanks!
Asked by Sebastian Carlos
(262 rep)
Jul 31, 2023, 09:08 PM
Last activity: Aug 1, 2023, 09:24 AM
Last activity: Aug 1, 2023, 09:24 AM