- Published on
Graceful Shutdown vs Hard Shutdown
- Authors
- Name
- Van-Loc Nguyen
- @vanloc1808
Introduction
In this blog, we'll explore the differences between graceful and hard shutdowns, two common ways to stop a process.
What is a Shutdown?
A shutdown is the process of stopping a process. It is a way to tell the process to stop running.
Graceful Shutdown
A graceful shutdown is a shutdown that allows the process to finish its current work and exit cleanly. It sends the SIGTERM signal, allowing the process to handle the shutdown gracefully, finish its current work, do some cleanup if necessary, and then exit.
Hard Shutdown
A hard shutdown is a shutdown that does not allow the process to finish its current work and exit cleanly. It sends the SIGKILL signal, which is a forceful way to stop the process.
Example
In MacOS Activity Monitor screen, we can choose to quit or force quit a process.
- Quit: This is a graceful shutdown. It sends the SIGTERM signal, allowing the process to handle the shutdown gracefully, finish its current work, do some cleanup if necessary, and then exit.
- Force Quit: This is a hard shutdown. It sends the SIGKILL signal, which is a forceful way to stop the process.

Difference between Graceful and Hard Shutdown
The main difference between graceful and hard shutdowns is that a graceful shutdown allows the process to finish its current work and exit cleanly, while a hard shutdown does not allow the process to finish its current work and exit cleanly.
Conclusion
Graceful shutdown is a good way to stop a process. It allows the process to finish its current work and exit cleanly. Hard shutdown is not a recommended way to stop a process. It does not allow the process to finish its current work and exit cleanly.