Linux下的Java守护进程:选择? [英] Java daemon under Linux: Choices?
问题描述
我有一个控制台应用程序(用Java编写),应该在Linux机器上运行直到它停止。
日志记录由应用程序本身完成。 / p>
每当有新版本可用时,应用程序都需要停止(即我登录,停止应用程序,复制新的JAR文件,然后再次启动它)。
除了下面指定的那些之外,有哪些实现这个的选项?
已知的方法:
1)Tanuki服务包装
2)nohup java -jar myapp-1.32.jar&
一些现代Linux发行版已切换到新贵。这是一个daeomon启动和停止所有其他服务。我肯定会调查一下。因为它解决了生产就绪启动脚本的一些棘手问题。缺点是它没有特定于Java的功能。
I have a console application (written in Java), which should run on a Linux machine until it is stopped.
Logging is done by the application itself.
The application needs to be stopped whenever a new version is available (i. e. I login, stop the application, copy the new JAR file, and then launch it again).
What are the options for implementing this, apart from those specified below?
Known ways to do it:
1) Tanuki service wrapper
2) nohup java -jar myapp-1.32.jar &
Some modern Linux distributions have switched to upstart. That's a daeomon starting and stopping all the other services. I'd definitely look into that. Since it solves some tricky problems with production ready start scripts. The downside is that it has no java specific functionality.
这篇关于Linux下的Java守护进程:选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!