My server program received a SIGTERM and stopped (with exit code 0). I am surprised by this, as I am pretty sure that there was plenty of memory for it. Under what conditions does linux (busybox) send a SIGTERM to a process?
|
I'll post this as an answer so that there's some kind of resolution if this turns out to be the issue. An exit status of 0 means a normal exit from a successful program. An exiting program can choose any integer between 0 and 255 as its exit status. Conventionally, programs use small values. Values 126 and above are used by the shell to report special conditions, so it's best to avoid them. At the C API level, programs report a 16-bit status¹ that encodes both the program's exit status and the signal that killed it, if any. In the shell, a command's exit status (saved in In particular, if ¹ roughly speaking |
|||
|
|
|
Are you sure it exited on SIGTERM? The kernel nor busybox would never generate this normally. If the program actually exited on a signal, it would not have an exit code unless you caught the signal and did a normal exit. You mentioned working with serial ports and sockets, it is possibly that it's a SIGPIPE that's killing it? Or possibly a SIGINT due to receiving a Control-C over the serial port? |
|||
|
|
|
kernel can generate SIGTERM when running low on disk space or there is a hardware interrupt...caused by some error |
|||
|
|
$?would be set to 143 (128 + signal number). – Gilles Mar 30 '11 at 18:36