I have a custom application running on an embedded x86 setup (built using buildroot and uClibc). The application has been running fine but this morning when I returned to work I discovered my process had been killed and the following output on my terminal
SAK: killed process 1008 (CX_SC3): fd#4 opened to the tty SAK: killed process 1009 (CX_SC3): fd#4 opened to the tty SAK: killed process 1011 (CX_SC3): fd#4 opened to the tty SAK: killed process 1012 (CX_SC3): fd#4 opened to the tty
CX_SC3 is my process - it has multiple threads, one of which opens
/dev/ttyS0 to send messages over a radio modem. The fd number is 4 for the serial port. What I don't understand is
- What the SAK means
- The PID listed above must refer to a process that was killed by my application as there is only ever one instance of my application running at a time. Is it possible that these PIDs are actually my thread IDs (as my application does run 4 threads always).
- If my application killed other processes, why was my application also killed?
- What does the
opened to the ttypart mean? From some research this suggests that this has something to do with a interrupt character sent to the tty that I used to start the program.
I am sure that the above is pretty obvious when you are a linux guru but I am struggling - can anyone suggest what events could have lead to the following output? My embedded setup is very small, uses
busybox and runs
vsftpd and very little else other than my custom application. It is vital that my application is robust so if anyone can suggest/guess as to what sequence of events could have caused the above I will be very grateful.
EDIT: In response to the comment below, if this is due to a SAK being detected, is there anything that can accidentally trigger this? Is it possible that anything being read on the serial port has triggered this? Also, how can I find the SAK combination for my system - I do not have a
rc.local file anywhere in my root file system.
UPDATE: I have managed to pin this event down to the point at which my host machine shuts down. I have a serial cable between my host machine and my target device which I use to send serial data to the embedded target. When I leave the target running, but shutdown the host, my application is killed as described above. When I disconnect the serial cable prior to shutting down my host machine then my application does not get killed and runs as normal. This behaviour happens even after I have performed
echo 0 > /proc/sys/kernel/sysrq