From owner-freebsd-arch@FreeBSD.ORG Sun Aug 1 01:37:18 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55B9716A4CE for ; Sun, 1 Aug 2004 01:37:17 +0000 (GMT) Received: from smtp3.server.rpi.edu (smtp3.server.rpi.edu [128.113.2.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCA9343D58 for ; Sun, 1 Aug 2004 01:37:16 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp3.server.rpi.edu (8.13.0/8.13.0) with ESMTP id i711bFlk026945 for ; Sat, 31 Jul 2004 21:37:16 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: Date: Sat, 31 Jul 2004 21:37:15 -0400 To: freebsd-arch@FreeBSD.ORG From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) Subject: Random-ness when booting into single-user X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Aug 2004 01:37:18 -0000 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@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu