Random-ness when booting into single-user
Garance A Drosihn
drosih at rpi.edu
Sat Jul 31 18:37:18 PDT 2004
When I was at the devsummit, a few developers remarked at the
annoying situation one can get into when booting into single-
user mode. Something about various operations which can hang
because they need some random number(s), but at that point
/dev/random (or whatever the key thing is) has not been seeded
with enough entropy to give random numbers. Apparently once
you get into this state, you have to start typing a lot of
random gibberish to get past the problem. Something about
"dancing the fandango", if I remember right.
Happily I have not run into this, and I think I would like to
make sure that I don't run into it -- even though I obviously
don't remember any of the details...
I have been looking at sbin/init/init.c, and I was wondering
if it might be fairly easy to provide a fix to this situation.
Let's say you request single-user mode. If you asked for
single-user mode, init.c is what will ask you which shell you
want use.
Once it knows the shell, couldn't it just do something like
first execute:
${SHELL} -c /etc/rc.d/preseedrandom
(and ignore any failures)
And *then* execute the standard
${SHELL}
for single-user mode?
Or maybe it would execute some other script to seed the
entropy, if /etc/rc.d/preseedrandom is not appropriate under
those circumstances.
--
Garance Alistair Drosehn = gad at gilead.netel.rpi.edu
Senior Systems Programmer or gad at freebsd.org
Rensselaer Polytechnic Institute or drosih at rpi.edu
More information about the freebsd-arch
mailing list