Always app Java end with “Exit 143” Ubuntu

这一生的挚爱 提交于 2019-12-17 16:34:27

问题


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


回答1:


Exit code 143 corresponds to SIGTERM, which is the signal sent by default when you run kill <pid>. Is it possible that another process or user is killing the application? Without more information it's difficult to suggest anything else.




回答2:


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):

kill_anything_that_is_still_running_from_previous_execution()
start_a_lot_of_stuff()

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 after start_a_lot_of_stuff finished running, which is obviously not very great. #spawncamping

Oh, and in Java Runtime.getRuntime().exec("bash -c \"killall whatever\"") is "async" if you don't wait for it to exit.



来源:https://stackoverflow.com/questions/4192364/always-app-java-end-with-exit-143-ubuntu

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!