SVN: rc-scripts/branches/upstart_native/rc.d/init.d/random

jajcus jajcus at pld-linux.org
Mon May 10 09:27:30 CEST 2010


Author: jajcus
Date: Mon May 10 09:27:30 2010
New Revision: 11413

Modified:
   rc-scripts/branches/upstart_native/rc.d/init.d/random
Log:
- make 'status' action useful'

Modified: rc-scripts/branches/upstart_native/rc.d/init.d/random
==============================================================================
--- rc-scripts/branches/upstart_native/rc.d/init.d/random	(original)
+++ rc-scripts/branches/upstart_native/rc.d/init.d/random	Mon May 10 09:27:30 2010
@@ -51,11 +51,12 @@
 	fi
 	;;
   status)
-	# this is way overkill, but at least we have some status output...
-	if [ -c /dev/random ] ; then
-		nls "The random data source exists"
-	else
+  	entropy_avail="$(cat /proc/sys/kernel/random/entropy_avail)"
+	if [ "$entropy_avail" -eq 0 -o ! -c /dev/random ] ; then
 		nls "The random data source is missing"
+		exit 1
+	else
+		nls "$entropy_avail bytes of entropy available"
 	fi
 	;;
   *)


More information about the pld-cvs-commit mailing list