Kill -9 command and mongodb log

If I kill the mongod process with kill command, it will be in the mongodb log, but if I kill it with kill -9 command, it will not be in the mongodb log

Is there a way to log it?

SIGKILL cannot be caught so it cannot be logged.

1 Like

That was exactly what I expected. Thank you.:smiley:

Hi @Kim_Hakseon,

As @chris noted, SIGKILL cannot be caught or ignored by the mongod process.

I assume you are testing failure scenarios, but keep in mind that this signal also doesn’t give the process an opportunity to cleanup or commit so your data files may end up in an inconsistent state.

Outside of failure testing with unimportant data you should never use SIGKILL (kill -9) to terminate a data-bearing mongod process.


1 Like

Aha, I see. I’ll be careful.
Thank you for your answer. :smiley:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.