Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Mar 2011 17:27:21 +0000
From:      Chris Rees <utisoft@gmail.com>
To:        freebsd-standards@freebsd.org, utisoft@gmail.com,  Maxim Konovalov <maxim.konovalov@gmail.com>
Cc:        Oliver Fromme <olli@lurza.secnetix.de>
Subject:   Re: dd dies on SIGUSR1
Message-ID:  <AANLkTinzhKi-sfW-kz9W6EkA0WtB5-nO0gpyCLRyyHCn@mail.gmail.com>
In-Reply-To: <201103221457.p2MEvJub035858@lurza.secnetix.de>
References:  <AANLkTikoZNpmM83%2BU-0AWhO43K67gKNq1dZ4UnL2UAPo@mail.gmail.com> <201103221457.p2MEvJub035858@lurza.secnetix.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 22 March 2011 14:57, Oliver Fromme <olli@lurza.secnetix.de> wrote:
> Chris Rees <utisoft@gmail.com> wrote:
> =A0> Maxim Konovalov <maxim.konovalov@gmail.com> wrote:
> =A0> > FreeBSD uses SIGINFO for such purposes for ages in many programs
> =A0> > apart from dd(1). =A0IMHO, nothing to fix here.
> =A0>
> =A0> Of course, and I'm not suggesting that FreeBSD is wrong in any way.
> =A0>
> =A0> My point was that it was rather a harsh punishment for using a GNU-i=
sm
> =A0> where dd died after 30 minutes of chugging or so.
>
> Well, when it died, it did exactly what you told it to:
> Terminating the process is the default action for SIGUSR1,
> see signal(3), and the dd(1) manpage doesn't mention that
> SIGUSR1 is used for anything (in rather states that SIGINFO
> is used for the purpose that you intended), so the default
> action applies.
>
> I tend to agree with Maxim here.
>
> =A0> Would it hurt for dd to ignore the signal rather than die? I imagine=
 a
> =A0> lot less than otherwise.
>
> But then -- for consistency -- you would have to apply the
> same patch to *all* programs that use SIGINFO, such as dump
> and tar. =A0And what should be done if a program uses SIGINFO
> for status display *and* SIGUSR1 for something completely
> unrelated, such as ftp(1)?
>
> Best regards
> =A0 Oliver
>

Thanks very much for your feedback.

/* XXX
*  If I'm flogging a dead horse, please tell me to shut up, because I
probably won't otherwise.
 */

Since POSIX has SIGUSR[12] as undefined, I think it's a POLA violation
to have processes die when provided.

As I see it, the advantages of changing the default behaviour of
SIGUSR[12] are as follows:

- It's often used by other platforms for other purposes; ignoring is
less astonishing than death

- Evidently it confuses many others, see the Wiki article [1], and I quote:
'Mac OS X's dd will break on USR1' [more astonishment]

The disadvantages:

- scripts relying on USR1 and USR2 for death break (is this remotely a
good idea??)

I then propose that for consistency between apps as you already
suggested, and to be less astonishing SIGUSR1 and SIGUSR2 could be
changed to ignore by default?

I'm happy to put a patch into the PR if necessary.

Most importantly, will this make any difference to anyone but refugees
from That Other OS, and will this difference be negative in any way?

Chris

[1] http://en.wikipedia.org/wiki/SIGUSR1_and_SIGUSR2



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinzhKi-sfW-kz9W6EkA0WtB5-nO0gpyCLRyyHCn>