When running as a daemon, a signal handler is installed to catch SIGINT/SIGTERM. This handler sets a flag that's tested in the main loop. However, rngd loops in update_kernel_random(), where the flag is not tested.

The patch attached fixes this problem.