Fibre Channel (SAN)

random

by sascript on ‎03-15-2005 11:02 PM - edited on ‎10-30-2013 01:43 PM by bcm1 (256 Views)

DETAILED DESCRIPTION  <br/>

<br/>

 

  1. random Script to snapshot random state and reload it at boot time.<br/>

#

  1. chkconfig: 2345 20 80
  2. description: Saves and restores system entropy pool for higher quality \
  3. random number generation.

 

  1. Source function library.

. /etc/rc.d/init.d/functions

random_seed=/var/run/random-seed

  1. See how we were called.

case "$1" in
start)

   

  1. Carry a random seed from start-up to start-up<br/>

   

  1. Load and then save 512 bytes, which is the size of the entropy pool<br/>

  if <a class="jive-link-adddocument" href="http://community.brocade.com/home/community-document-picker.jspa?communityID=2006&subject=-f%24random_seed+"> -f $random_seed </a>; then<br/>

    cat $random_seed &gt;/dev/urandom<br/>

  else<br/>

    touch $random_seed<br/>

  fi<br/>

  action "Initializing random number generator" /bin/true<br/>

  chmod 600 $random_seed<br/>

  dd if=/dev/urandom of=$random_seed count=1 bs=512 2&gt;/dev/null<br/>

  touch /var/lock/subsys/random <br/>

<br/>

  ;;<br/>

<br/>

stop)<br/>

   

  1. Carry a random seed from shut-down to start-up<br/>

   

  1. Save 512 bytes, which is the size of the entropy pool<br/>

  touch $random_seed<br/>

  chmod 600 $random_seed<br/>

  action "Saving random seed" dd if=/dev/urandom of=$random_seed count=1 bs=512 2&gt;/dev/null <br/>

<br/>

  rm -f /var/lock/subsys/random<br/>

  ;;<br/>

status)<br/>

   

  1. this is way overkill, but at least we have some status output...<br/>

  if -c /dev/random ; then
echo "The random data source exists"
else
echo "The random data source is missing"
fi
;;
restart|reload)

   

  1. do not do anything; this is unreasonable<br/>

  :<br/>

  ;;<br/>

*)<br/>

   

  1. do not advertise unreasonable commands that there is no reason<br/>

   

  1. to use with this device<br/>

  echo "Usage: random {start|stop|status|restart|reload}"
exit 1
esac

exit 0

 

REQUIREMENTS

Operating System Linux

Interface Saves and restores system entropy pool for higher quality

Fabric Operating System Not Given

Other Not Given

 

NOTES (INCLUDING LIMITATIONS)

aves and restores system entropy pool for higher quality \

  1. random number generation.

 

NOTE: This contribution was migrated by Brocade from the former Brocade Connect community on March 13, 2008, on behalf of the author.

Contributors