Normally, we started applications from the terminals(or console), and the terminal which starts the applications will be the standard io of the applications.
If we close the terminals, the applications started by the terminal will normally be closed as well. But for those daemon processes are not closed. My questions is how terminal decides which applications to close, which not? And if I wanna write a daemon application, what shall I do to prevent being closed?
For those applications not closed, what happens if they print out something to the standout. Since the terminal is closed, where will the output go?
Thanks.