From bc70c8273792c3cbe41edca1a90f62b4ff0666a1 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 29 Jul 2014 12:07:02 +0200 Subject: [PATCH] rngd: Silence initscript when rngd is already started. 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 | 1 + src/initscripts/init.d/rngd | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config/rootfiles/core/80/filelists/files b/config/rootfiles/core/80/filelists/files index 5f4c42cee0..a12048d7bb 100644 --- a/config/rootfiles/core/80/filelists/files +++ b/config/rootfiles/core/80/filelists/files @@ -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 diff --git a/src/initscripts/init.d/rngd b/src/initscripts/init.d/rngd index 22437fdc4e..df4aa7da2f 100644 --- a/src/initscripts/init.d/rngd +++ b/src/initscripts/init.d/rngd @@ -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) -- 2.39.5