]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
rngd: Silence initscript when rngd is already started.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 29 Jul 2014 10:07:02 +0000 (12:07 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 29 Jul 2014 10:07:02 +0000 (12:07 +0200)
When a hardware random number generator is found by udev
it will start rngd automatically which is what we also do
by default in the initialisation sequence of the system
(e.g. for RDRAND).
The user will then see an error message that rngd has
already been started which was confusing.

config/rootfiles/core/80/filelists/files
src/initscripts/init.d/rngd

index 5f4c42cee01a9c92fb0067857c75adf4b5c63a69..a12048d7bbe4782807966529314d111db9d9b30d 100644 (file)
@@ -6,6 +6,7 @@ etc/rc.d/init.d/dhcrelay
 etc/rc.d/init.d/dnsmasq
 etc/rc.d/init.d/firewall
 etc/rc.d/init.d/networking/red.up/30-ddns
+etc/rc.d/init.d/rngd
 srv/web/ipfire/cgi-bin/ddns.cgi
 srv/web/ipfire/cgi-bin/logs.cgi/firewalllogcountry.dat
 srv/web/ipfire/cgi-bin/logs.cgi/log.dat
index 22437fdc4e5c2b4a9603d18a3f4d1fb521496c2a..df4aa7da2f26d3b5b922ba6590867ceaf28ef82f 100644 (file)
@@ -28,12 +28,18 @@ case "${1}" in
                fi
 
                boot_mesg "Starting Random Number Generator Daemon..."
-               loadproc /usr/sbin/rngd --no-tpm=1
+
+               if pidofproc /usr/sbin/rngd &>/dev/null; then
+                       # Is already running.
+                       echo_ok
+               else
+                       loadproc /usr/sbin/rngd --no-tpm=1
+               fi
                ;;
 
        stop)
                boot_mesg "Stopping Random Number Generator Daemon..."
-               killproc /usr/sbin/rngd
+               killproc -p /var/run/rngd.pid /usr/sbin/rngd
                ;;
 
        restart)