[Pkg-sysvinit-commits] r186 -
sysvinit/trunk/debian/initscripts/etc/init.d
Thomas Hood
jdthood-guest at costa.debian.org
Mon Nov 21 11:58:20 UTC 2005
Author: jdthood-guest
Date: 2005-11-21 11:58:20 +0000 (Mon, 21 Nov 2005)
New Revision: 186
Modified:
sysvinit/trunk/debian/initscripts/etc/init.d/urandom
Log:
Remove old Miquel version comment; fix indentation
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/urandom
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/urandom 2005-11-21 11:56:18 UTC (rev 185)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/urandom 2005-11-21 11:58:20 UTC (rev 186)
@@ -9,9 +9,6 @@
# Description This script saves the random seed between reboots.
# It is called from the boot, halt and reboot scripts.
### END INIT INFO
-#
-# Version: @(#)urandom 2.85-14 31-Mar-2004 miquels at cistron.nl
-#
[ -c /dev/urandom ] || exit 0
@@ -28,46 +25,45 @@
SAVEDFILE=/var/lib/urandom/random-seed
case "$1" in
- start|"")
- [ "$VERBOSE" != no ] && log_action_begin_msg "Initializing random number generator"
-
- # Load and then save $POOLSIZE bytes,
- # which is the size of the entropy pool
- if [ -f "$SAVEDFILE" ]
+ start|"")
+ [ "$VERBOSE" != no ] && log_action_begin_msg "Initializing random number generator"
+ # Load and then save $POOLSIZE bytes,
+ # which is the size of the entropy pool
+ if [ -f "$SAVEDFILE" ]
+ then
+ # Handle locally increased pool size
+ SAVEDSIZE=`find $SAVEDFILE -printf "%s"`
+ if [ "$SAVEDSIZE" -gt "$POOLSIZE" ]
then
- # Handle locally increased pool size
- SAVEDSIZE=`find $SAVEDFILE -printf "%s"`
- if [ "$SAVEDSIZE" -gt "$POOLSIZE" ]
- then
- [ -w /proc/sys/kernel/random/poolsize ] && echo $POOLSIZE > /proc/sys/kernel/random/poolsize
- POOLSIZE=$SAVEDSIZE
- fi
- cat "$SAVEDFILE" >/dev/urandom
+ [ -w /proc/sys/kernel/random/poolsize ] && echo $POOLSIZE > /proc/sys/kernel/random/poolsize
+ POOLSIZE=$SAVEDSIZE
fi
- rm -f $SAVEDFILE
- umask 077
- dd if=/dev/urandom of=$SAVEDFILE bs=$POOLSIZE count=1 >/dev/null 2>&1
- ES=$?
- umask 022
- [ "$VERBOSE" != no ] && log_action_end_msg $ES
- ;;
- stop)
- # Carry a random seed from shut-down to start-up;
- # see documentation in linux/drivers/char/random.c
- [ "$VERBOSE" != no ] && log_action_begin_msg "Saving random seed"
- umask 077
- dd if=/dev/urandom of=$SAVEDFILE bs=$POOLSIZE count=1 >/dev/null 2>&1
- ES=$?
- [ "$VERBOSE" != no ] && log_action_end_msg $ES
- ;;
- restart|reload|force-reload)
- echo "Error: argument '$1' not supported" >&2
- exit 3
- ;;
- *)
- echo "Usage: urandom start|stop" >&2
- exit 3
- ;;
+ cat "$SAVEDFILE" >/dev/urandom
+ fi
+ rm -f $SAVEDFILE
+ umask 077
+ dd if=/dev/urandom of=$SAVEDFILE bs=$POOLSIZE count=1 >/dev/null 2>&1
+ ES=$?
+ umask 022
+ [ "$VERBOSE" != no ] && log_action_end_msg $ES
+ ;;
+ stop)
+ # Carry a random seed from shut-down to start-up;
+ # see documentation in linux/drivers/char/random.c
+ [ "$VERBOSE" != no ] && log_action_begin_msg "Saving random seed"
+ umask 077
+ dd if=/dev/urandom of=$SAVEDFILE bs=$POOLSIZE count=1 >/dev/null 2>&1
+ ES=$?
+ [ "$VERBOSE" != no ] && log_action_end_msg $ES
+ ;;
+ restart|reload|force-reload)
+ echo "Error: argument '$1' not supported" >&2
+ exit 3
+ ;;
+ *)
+ echo "Usage: urandom start|stop" >&2
+ exit 3
+ ;;
esac
exit 0
More information about the Pkg-sysvinit-commits
mailing list