Attaching signal handlers.