linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Arseny Maslennikov <ar@cs.msu.ru>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>, Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Vladimir D. Seleznev" <vseleznv@altlinux.org>,
	Rob Landley <rob@landley.net>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH v2 4/7] linux/signal.h: Ignore SIGINFO by default in new tasks
Date: Tue, 25 Jun 2019 17:32:15 -0400	[thread overview]
Message-ID: <20190625213215.GB3116@mit.edu> (raw)
In-Reply-To: <20190625161153.29811-5-ar@cs.msu.ru>

On Tue, Jun 25, 2019 at 07:11:50PM +0300, Arseny Maslennikov wrote:
> This matches the behaviour of other Unix-like systems that have SIGINFO
> and causes less harm to processes that do not install handlers for this
> signal, making the keyboard status character non-fatal for them.
> 
> This is implemented with the assumption that SIGINFO is defined
> to be equivalent to SIGPWR; still, there is no reason for PWR to
> result in termination of the signal recipient anyway — it does not
> indicate there is a fatal problem with the recipient's execution
> context (like e.g. FPE/ILL do), and we have TERM/KILL for explicit
> termination requests.

So this is a consequence of trying to overload SIGINFO with SIGPWR.
At least on some legacy Unix systems, the way SIGPWR worked was that
init would broadcast SIGPWR to all userspace process (with system
daemons on an exception list so they could get shutdown last).
Applications which didn't have a SIGPWR handler registered, would just
exit.  Those that did, were expected to clean up in preparation with
the impending shutdown.  After some period of time, then processes
would get hard killed and then system daemons would get shut down and
the system would cleanly shut itself down.

So SIGPWR acted much like SIGHUP, and that's why the default behavior
was "terminate".  Now, as far as I know, we've not actually used in
that way, at least for most common distributions, but there is a sane
reason why things are they way there are, and in there are people who
have been using SIGPWR the way it had originally been intended, there
is risk in overloading SIGINFO with SIGPWR --- in particular, typing
^T might cause some enterprise database to start shutting itself down.  :-)

(In particular it might be worth checking Linux ports of Oracle and
DB2.)

					- Ted

  reply	other threads:[~2019-06-25 21:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25 16:11 [PATCH v2 0/7] TTY Keyboard Status Request Arseny Maslennikov
2019-06-25 16:11 ` [PATCH v2 1/7] signal.h: Define SIGINFO on all architectures Arseny Maslennikov
2019-06-25 16:11 ` [PATCH v2 2/7] tty: termios: Reserve space for VSTATUS in .c_cc Arseny Maslennikov
2019-06-25 16:11 ` [PATCH v2 3/7] n_tty: Send SIGINFO to fg pgrp on status request character Arseny Maslennikov
2019-06-25 16:11 ` [PATCH v2 4/7] linux/signal.h: Ignore SIGINFO by default in new tasks Arseny Maslennikov
2019-06-25 21:32   ` Theodore Ts'o [this message]
2019-06-26 13:49     ` Arseny Maslennikov
2019-07-29 10:55     ` Arseny Maslennikov
2019-06-25 16:11 ` [PATCH v2 5/7] tty: Add NOKERNINFO lflag to termios Arseny Maslennikov
2019-06-25 16:11 ` [PATCH v2 6/7] n_tty: ->ops->write: Cut core logic out to a separate function Arseny Maslennikov
2019-06-25 16:11 ` [PATCH v2 7/7] n_tty: Provide an informational line on VSTATUS receipt Arseny Maslennikov
2019-07-30 16:19   ` Greg Kroah-Hartman
2019-07-31 22:23     ` Arseny Maslennikov
2019-08-01  9:20       ` Greg Kroah-Hartman
2019-08-01 10:10         ` Pavel Machek
2019-08-01 12:44         ` Rob Landley
2019-08-02 11:04         ` Arseny Maslennikov
2019-08-01 12:35     ` Rob Landley
2019-07-29 10:56 ` [PATCH v2 0/7] TTY Keyboard Status Request Arseny Maslennikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190625213215.GB3116@mit.edu \
    --to=tytso@mit.edu \
    --cc=ar@cs.msu.ru \
    --cc=ebiederm@xmission.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=peterz@infradead.org \
    --cc=rob@landley.net \
    --cc=vseleznv@altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).