14

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

Fernando
  • 165
  • 1
  • 1
  • 3
  • 3
    We're not clairvoyant. Provide more info if you want answers. I'd say the problem lies in your Java app. – darioo Nov 16 '10 at 08:50
  • I disagree with this being marked as duplicate. I was searching for what exit code 143 means, and this question and the accepted answer explained it perfectly. The question that this supposedly duplicates does NOT answer the problem I was searching for. – Jim Tough Jun 07 '18 at 14:06

2 Answers2

39

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.

Adamski
  • 54,009
  • 15
  • 113
  • 152
  • I do not think that is another user, maybe another process? I did this to try and protect myself from SIGTERM, how do you see? – Fernando Nov 16 '10 at 09:19
  • 1
    This can happen in a Docker environment when the container decides that something is using too much memory and kills the largest process. – mjaggard Jan 28 '20 at 16:45
5

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.

Tarnay Kálmán
  • 6,907
  • 5
  • 46
  • 57