Add explicit signal handling and server restarting