dd dies on SIGUSR1

Chris Rees utisoft at gmail.com
Tue Mar 22 20:02:18 UTC 2011


On 22 March 2011 18:16, David Schultz <das at freebsd.org> wrote:
> On Tue, Mar 22, 2011, Chris Rees wrote:
>> Since POSIX has SIGUSR[12] as undefined, I think it's a POLA violation
>> to have processes die when provided.
>
> Quite the contrary: The default behavior of SIGUSR1 on FreeBSD
> follows both POSIX and historical precedent, so changing it would
> be a violation of POLA.  Terminating the process is also the
> default on Linux.

However... I still think that because no-one in their right mind would
use SIGUSR[12] to terminate a program it's pointless for it to happen,
and can only cause annoyance.

People want to hold onto historical behaviour for no good reason, and
I feel that this is one of these occasions. There is no reason for it
apart from 'that's how it always has been [because no-one's
complained]'. I also disagree that it 'follows' POSIX, POLA *IMO* for
undefined behaviour is generally do nothing or report an error.

> Linux dd's interpretation of SIGUSR1 seems rather poorly
> considered, since as you note, utilities that don't handle it will
> simply die unexpectedly.  However, it certainly wouldn't hurt to
> patch FreeBSD's dd to handle SIGUSR1 the same way as SIGINFO.
>

Could the original patch in the PR be good enough then?

Thank you for the thoughts.

I'm sorry if I seem to be ranting, and I fully understand if my
proposal of changing the default of USR1 is rejected completely; I
just wanted to have a reasoned discussion.

David, if you think the original patch (which does what your last
paragraph says) is OK then feel free to take that as the Fix.

Thanks!

Chris


More information about the freebsd-standards mailing list