To What Extent Can One Rely on Writing to Disk When SIGTERM is Given?
问题 I am developing for Linux and have a daemon that should write to disk when it is killed. The daemon could be configured to listen to SIGTERM and write to disk when that signal is received. I am also familiar with the PrepareForShutdown D-Bus signal issued by the login manager. Listening to SIGTERM results in simpler code than inhibiting shutdown and listening to the PrepareForShutdown signal. Another advantage of SIGTERM is that it handles cases where the daemon is politely killed even though