Categories
Linux Tutorial Series

Linux Tutorial Series – 157 – Shutting down your system – what goes on

Here is the video version, if you prefer it:

When you want to shut down your system, the following happens: (Ward, 2014)⁠

  1. init asks every process to shut down
  2. If some processes (or a process) don’t respond, init initiates a kill with a TERM signal
  3. If some processes (or a process) don’t respond still, init initiates a kill with a KILL signal
  4. The system makes preparations for a shutdown
  5. The system unmounts all of the other filesystems other than root
  6. The system remounts the root filesystem in read-only mode (meaning you can’t write, only read)
  7. The system writes out all of the data left over in the buffers to the filesystem (this happens during the remounting process; see (“Is the root filesystem unmounted during a Linux shutdown?,” n.d.)⁠)
  8. The kernel reboots or stops the system

My 2 cents – just know this conceptually. The only case where you will need to go deep into the details of this will be if you need to optimize something on a Linux machine (most likely you would be doing this professionally), if you need to know the details to accomplish some other task or if you are really really curious.

Hope you learned something useful!

References

Is the root filesystem unmounted during a Linux shutdown? (n.d.). Retrieved February 13, 2020, from https://unix.stackexchange.com/questions/298216/is-the-root-filesystem-unmounted-during-a-linux-shutdown

Ward, B. (2014). How Linux Works: What Every Superuser Should Know (2nd ed.). No Starch Press. Pages 144-145

NewsletterUpdates on interesting things I am doing

Subscribe to my newsletter to keep abreast of the interesting things I'm doing. I will send you the newsletter only when there is something interesting. This means 0% spam, 100% interesting content.

Leave a Reply

Your email address will not be published. Required fields are marked *