Fibre Channel (SAN)

random

by sascript on ‎03-16-2005 12:00 AM (194 Views)

DETAILED DESCRIPTION <br/>

<br/>

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

#

  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

  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}"