-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Spawned procs should inherit goreman's stdin #140
base: master
Are you sure you want to change the base?
Spawned procs should inherit goreman's stdin #140
Conversation
What happen for this? It is not guaranteed which one will be called first? |
Yep, there are no guarantees, the point is not to guarantee which tool gets to read from stdin the point is to 1. match how foreman works, 2. provide for tools that expect to be run via a tty. |
My example was to demonstrate that the processes foreman starts inherit foreman's stdin, not to enable some kind of specific ordering of stdin behavior. |
Is it a specification that foreman handles standard input? If so, please show me the specification or the source code that intentionally implements it. I can't implement it without specification. |
Here's the code: https://github.com/ddollar/foreman/blob/1445adc429d79b5b3dd1d54cf9dcb75d253c924f/lib/foreman/process.rb#L54 Foreman uses Since the docs for
Tada! Proof that foreman spawns processes such that they all inherit stdin from the main foreman process. I've also demonstrated that this matters to some processes. |
is this going forward ? stdin is really useful feature. I guess you would all agree. |
Processes spawned via
foreman
inherit stdin from it. You can test this like so:Why does this matter? Because some things care if stdin is a TTY or
/dev/null
(the previous stdin value for all launched procs):You could always redirect
/dev/null
into your processes if that's what you want but forcing them to inherit your terminal's TTY is impossible if goreman is inserting/dev/null
as stdin and so I think this is the better default.Thoughts?