sailoog / openplotter

Obsolete project. New one and active: https://github.com/openplotter
http://www.sailoog.com/openplotter
GNU General Public License v2.0
153 stars 53 forks source link

killing process with -9 flag could cause file corruption. #239

Open FredericGuilbault opened 5 years ago

FredericGuilbault commented 5 years ago

kill with -15 is the proper way to tell a program finish what it is doing and shutdown , -9 is only for process that does not respond.

This guy explain it better then me :

The SIGTERM signal tells the process that it should perform it’s shutdown proceedures to terminate the process cleanly by closing all log files, connections, etc.

Unlike SIGTERM the SIGKILL signal cannot be captured by the process and thus it cannot be ignored. The SIGKILL signal is handled outside of the process completely, and is used to stop the process immediately. The problem with using SIGKILL is that it does not allow an application to close its open files or database connections cleanly and over time could cause other issues; therefor it is generally better to reserve the SIGKILL signal as a last resort.

Sauce: https://bencane.com/2014/04/01/understanding-the-kill-command-and-how-to-terminate-processes-in-linux/

sailoog commented 5 years ago

Thanks, we are using -9 everywhere! I will apply this on v2.x.x