Subject: bug#36160: 25.2; Emacs does not ask to save modified files when shutting down OS

From: Eli Zaretskii <[email-masked]>
Date: Wed, 26 Aug 2020 09:14:50 +0300

> From: Stefan Kangas <[email-masked]>
> Date: Tue, 25 Aug 2020 17:46:44 -0700
> Cc: Eli Zaretskii <[email-masked]>, [email-masked], [email-masked], 
> 	[email-masked]
> 
> Glenn Morris <[email-masked]> writes:
> 
> > Eli Zaretskii wrote:
> >
> >> But how to distinguish SIGTERM due to system shutdown and SIGTERM when
> >> the user triggers the signal?
> >
> > I don't think one can, or should.
> 
> Is this therefore a wontfix?

I guess so.

> (FWIW, It seems to me that we would need a solution for this on a
> GNU/Linux level before we can do something in Emacs.  And AFAIK there is
> no way for a user level program to halt a system halt.)

I think we support the session management protocol for this, see
xsmfns.c.