Linux下的Java守护进程:选择? [英] Java daemon under Linux: Choices?

查看:229
本文介绍了Linux下的Java守护进程:选择?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个控制台应用程序(用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆