[rng-tools] rngd daemon waits to respond to SIGTERM
Brought to you by:
jgarzik
rng-tools-4 using Ivy Bridge (i3770) DRNG on Gentoo Linux, kernel gentoo-sources-3.5.2
- rngd running as daemon
1) killall rngd
- rngd still running
2) cat /dev/random > /dev/null
- rngd not running
rngd running in the foreground will stop immediately on SIGTERM
and can stop rngd daemon immediately with:
killall -s SIGALRM rngd
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.