开发者

how the terminal control the applications started by themself

Normally, we started开发者_开发技巧 applications from the terminals(or console), and the terminal which starts the applications will be the standard io of the applications.

  1. 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?

  2. 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.


Try the Apache JSVC package. It provides a proper executable, which knows how to arrange things in order for a java process to run as daemon under unix. It will also take care of the stdout/err channels, redirecting them into files or whatever you need. For windows, the procrun tool provides the capabilities to run a java VM as standard windows service.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜