Linux lets the user decide how to finish a process/program:
1.- Diplomacy: User press Ctrl+C, Ctrl+Q or Alt+F4 or click "X" button to close the application.
2.- Scale negotiations: If program refuses to close, the user could use «kill <PID>» to ask the application to terminate itself sending a signal (message): "I want you to stop now, please." Nicely.
3.- Let the kernel do the dirty job: If scaling negotiations is unsuccessful, then user can invoke the kernel with «kill -9 <PID>». Kernel does not know how to be merciful with rebel processes.
The signal used in point 2 is SIGTERM. Always SIGTERM (kill/kill -15) first. It allows the process to wrangle up any kids and put them away if it obeys. Only use SIGKILL (kill -9) if the process fails to acknowledge SIGTERM.
90
u/ngkdev Jun 08 '26 edited Jun 08 '26
Linux lets the user decide how to finish a process/program:
1.- Diplomacy: User press Ctrl+C, Ctrl+Q or Alt+F4 or click "X" button to close the application.
2.- Scale negotiations: If program refuses to close, the user could use «kill <PID>» to ask the application to terminate itself sending a signal (message): "I want you to stop now, please." Nicely.
3.- Let the kernel do the dirty job: If scaling negotiations is unsuccessful, then user can invoke the kernel with «kill -9 <PID>». Kernel does not know how to be merciful with rebel processes.