System will end processes from time to time.
Yes, the Linux kernel can kill processes when there is a severe lack of memory (and swap!). The feature that does this is called "oomkiller" (out of memory killer) and detailed information is written to the kernel log about the process was killed. You can see that log with dmesg
and the syslog server is usually configured to write it to /var/log/kern.log
.
However, if your system is running so low on memory that this happens on a regular basis, that's usually considered a critical problem that should be addressed. There is no way to control which process the oomkiller will choose to kill, and it might very well kill important system processes from time to time, so you cannot really count on your system being fully stable after this has happened.
I would also like to log user that uses kill cmd
That information is not collected or logged by anything and is not available. About the best you might hope for is that someone ran sudo kill <something>
in which case sudo
(not kill
) will log the command. But normal users probably aren't using sudo
.