Linux – Can it harm if I shutdown without closing applications

arch linuxconsolekitshutdown

Can it hurt if I shut down my machine without closing all programs? I normally close all of them by hand, but have heard from others that this is really not necessary anymore (i.e. Linux will take care of proper closing of programs before shutting down the computer). I normally run applications like Thunderbird, VIM (with no unsaved files opened), and browser windows when I shut down my pc. And I would make sure not to be writing anything to USB when shutting down.

Running Arch Linux and shutting down using ConsoleKit.

Best Answer

TL;DR

It's a best-practice to close any applications that might have unsaved data before shutting down.

Longer Explanation

It is the individual application's responsibility to gracefully handle a SIGTERM, but there are certainly cases where this will not suffice. Two examples that could cause data loss are:

  1. An application does not properly handle (or even ignores) SIGTERM.
  2. The application takes longer to save its data than the system allows before sending SIGKILL (e.g. around 5 seconds on Ubuntu according to the upstart cookbok).

A Few Practical Examples

I would personally recommend closing open documents in your text editor or word processor, but I wouldn't worry about Tomboy notes or open Firefox tabs. You should probably take care with any bulk file transfers in Nautilus, but I wouldn't worry about a resumable download with wget or transmission.

Like all things Unix-like, YMMV.

Related Question