From patchwork Mon Dec 4 04:27:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 1575 Return-Path: Received: from mail01.ipfire.org (unknown [172.28.1.200]) by web02.ipfire.org (Postfix) with ESMTP id 8A7C960D91 for ; Sun, 3 Dec 2017 18:27:57 +0100 (CET) Received: from mail01.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 13F9E1FD7; Sun, 3 Dec 2017 18:27:57 +0100 (CET) Received: from mx.link38.eu (mx.link38.eu [IPv6:2a03:4000:17:39a::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx.link38.eu", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 7A4C31FD7 for ; Sun, 3 Dec 2017 18:27:54 +0100 (CET) X-Virus-Scanned: ClamAV at mx.link38.eu Received: from mx-fra.brokers.link38.eu (mx-fra.brokers.link38.eu [10.141.75.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx.link38.eu (Postfix) with ESMTPS id C34424016F for ; Sun, 3 Dec 2017 18:27:48 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx-fra.brokers.link38.eu (Postfix) with ESMTPSA id 46E939F171 for ; Sun, 3 Dec 2017 18:27:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=link38.eu; s=201711; t=1512322068; x=1575394068; bh=EBpsYmT/zqUeStwvRHnlNvGjick3MUgbzwnzK/a2hHY=; h=Date:From:To:Subject:Message-ID:Content-Type:From:To:Subject:Date: Cc; b=rgYsU9zOMfM/qj73CjPINIOSUPGPXTu47l6m8YR18bfnMYj2s53/zVyP+8NKIY7R/ CDPFeZoDk9Xd8FRWbOdA1wlk7kqfaiP6MK+IROUtz3YSjRAjukJZeoVX4KhYkdkcC8 2F6IKbnTlSWrCwB1hf8ZjeubpNx3/6nMiMew3i5B8nMz6UWh/AfHVXP6mznQdfp6Cv AfB07BK7s+AlEsa6WLH+H5+GB4SYr9B/Q3NAPSi3dH4dZTUGPfcv3l1nzgupEWlY2T aYOwK4AlNHLTd87pKEni59rtp0C0wIDLY1CUSbJALfQ2Ze2WV7gGF2AoUg7Et16Ohp BPzBSjOzkwRUg== Date: Sun, 3 Dec 2017 18:27:46 +0100 From: Peter =?utf-8?q?M=C3=BCller?= To: "development@lists.ipfire.org" Subject: [PATCH v2] show RNGD status at WebUI service page, too Message-ID: <20171203182746.47ff6a10.peter.mueller@link38.eu> Organization: Link38 MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Also show the status of the hardware random number generator ("RNGD") at the services.cgi page in the WebUI. Before, this was only shown at the entropy.cgi page, which was a bit inconsistent. Signed-off-by: Peter Müller --- html/cgi-bin/services.cgi | 4 +++- src/initscripts/system/rngd | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/html/cgi-bin/services.cgi b/html/cgi-bin/services.cgi index 64fdbba05..eaaa5298a 100644 --- a/html/cgi-bin/services.cgi +++ b/html/cgi-bin/services.cgi @@ -56,6 +56,7 @@ my %servicenames =( $Lang::tr{'secure shell server'} => 'sshd', $Lang::tr{'vpn'} => 'charon', $Lang::tr{'web proxy'} => 'squid', + $Lang::tr{'random number generator daemon'} => 'rngd', 'OpenVPN' => 'openvpn' ); @@ -74,7 +75,8 @@ my %link =( "$Lang::tr{'intrusion detection system'} (GREEN)" => "$Lang::tr{'intrusion detection system'} (GREEN)", "$Lang::tr{'intrusion detection system'} (RED)" => "$Lang::tr{'intrusion detection system'} (RED)", "$Lang::tr{'intrusion detection system'} (ORANGE)" => "$Lang::tr{'intrusion detection system'} (ORANGE)", - "$Lang::tr{'intrusion detection system'} (BLUE)" => "$Lang::tr{'intrusion detection system'} (BLUE)" + "$Lang::tr{'intrusion detection system'} (BLUE)" => "$Lang::tr{'intrusion detection system'} (BLUE)", + "$Lang::tr{'random number generator daemon'}" => "$Lang::tr{'random number generator daemon'}" ); my $lines=0; # Used to count the outputlines to make different bgcolor diff --git a/src/initscripts/system/rngd b/src/initscripts/system/rngd index df4aa7da2..9abcf6a79 100644 --- a/src/initscripts/system/rngd +++ b/src/initscripts/system/rngd @@ -30,10 +30,16 @@ case "${1}" in boot_mesg "Starting Random Number Generator Daemon..." if pidofproc /usr/sbin/rngd &>/dev/null; then + # Make sure PID file is readable. + test -f /run/rngd.pid && chmod 755 /run/rngd.pid + # Is already running. echo_ok else loadproc /usr/sbin/rngd --no-tpm=1 + + # Make sure PID file is readable. + test -f /run/rngd.pid && chmod 755 /run/rngd.pid fi ;;