2009-06-09 11:13:25 +0100, Stephane Chazelas:
[...]
> that patch is still wrong.
> 
> The first time a HUP is received, we run the code in the trap
> and call wait which will wait for both the refresh command and
> the mysqld one.
> 
> But we won't return from that trap until mysqld dies, and in the
> trap the HUP signal is blocked, which means any subsequent
> HUP will not be handled.
[...]

That's only true with bash though. With 5 sh implementations, 4
different behaviors:

$ bash -c 'trap "echo x & wait" INT; sleep 5 & wait; :'
^Cx
^C^C^C^C^C^Cx

subsequent <Ctrl-C> are blocked until trap returns.

$ dash -c 'trap "echo x & wait" INT; sleep 5 & wait; :'
^Cx
^Cx
^Cx
^Cx
^Cx
^Cx
$ ksh -c 'trap "echo x & wait" INT; sleep 5 & wait; :'
^Cx
^Cx
^Cx
^Cx

Those happily rerun the trap from the trap.

$ pdksh -c 'trap "echo x & wait" INT; sleep 5 & wait; :'
^Cx

Here, the wait in trap returns immediately.

$ ARGV0=sh zsh -c 'trap "echo x & wait" INT; sleep 5 & wait; :'
^Cx
^C

Here, the second <Ctrl-C> is handled by the default handler.

The solution I proposed shouldn't have that portability issue.

Best regards,
Stephane



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to