hbal: change handling of signal
authorIustin Pop <iustin@google.com>
Mon, 22 Nov 2010 17:15:30 +0000 (17:15 +0000)
committerIustin Pop <iustin@google.com>
Tue, 23 Nov 2010 10:58:33 +0000 (10:58 +0000)
commit543e859d1e2f801414290e1979d3abf21e0e777b
tree60fcdcea44554c6d9b539eecf491cd476318732a
parent306cccd50ae224542b344f301ccb768dd32d616a
hbal: change handling of signal

Currently, hbal does a one-two signal handling, where the first signal
causes graceful termination, and the second one an immediate on (either
SIGINT or SIGTERM can be used, interchangeably). However, this poses a
timing problem: if two programs want to send a graceful termination
request, they cannot do that without careful coordination.

To fix this, we change to code to handle the signal separately: SIGINT
(^C) sends graceful termination, while SIGTERM sends immediate
termination. This should allow easier controlling of hbal.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Balazs Lecz <leczb@google.com>
hbal.hs