Implement carefully signal handling.