应用程序 Java 始终以“Exit 143”结尾乌班图
我有一个java应用程序,它被永久拉取了。按如下方式执行:
nohup ant> log.txt &
问题是无限期地持续下去,应用程序退出并收到消息“Exit 143”。
I have an application in java, which is permanently pulled. Execute it as follows:
nohup ant> log.txt &
The problem is that last indefinitely, the application quits and get a message "Exit 143".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
退出代码 143 对应于
SIGTERM
,这是运行kill
时默认发送的信号。是否有可能另一个进程或用户正在终止该应用程序?如果没有更多信息,就很难提出其他建议。Exit code 143 corresponds to
SIGTERM
, which is the signal sent by default when you runkill <pid>
. Is it possible that another process or user is killing the application? Without more information it's difficult to suggest anything else.我在使用 Nodejs 时遇到了类似的问题,结果发现实际上是我的应用程序和我的代码杀死了它。
我有这样的代码(好吧,我没有这样的函数名称,但你明白了):
问题是
kill_anything_that_is_still_running_from_previous_execution
是异步的并立即返回(由于“运气不好”) )实际的杀戮部分总是在start_a_lot_of_stuff
运行完成后才发生,这显然不是很好。 #spawncamping哦,在 Java 中
Runtime.getRuntime().exec("bash -c \"killallwhatever\"")
如果你不这样做的话,就是“异步”等待它退出。I ran into a similar issue while using nodejs, and it turned out that it was actually my app and my code that was killing it.
I had code like this (ok, i don't have function names like that, but you get the point):
The problem was that
kill_anything_that_is_still_running_from_previous_execution
was async and returned immediately and (due to bad "luck") the actual killing part always ended up happening only afterstart_a_lot_of_stuff
finished running, which is obviously not very great. #spawncampingOh, and in Java
Runtime.getRuntime().exec("bash -c \"killall whatever\"")
is "async" if you don't wait for it to exit.