From owner-freebsd-current@FreeBSD.ORG Sat Jun 24 14:33:18 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 699BD16A492; Sat, 24 Jun 2006 14:33:18 +0000 (UTC) (envelope-from Alexander@Leidinger.net) Received: from www.ebusiness-leidinger.de (jojo.ms-net.de [84.16.236.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id E187F43D48; Sat, 24 Jun 2006 14:33:17 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from Andro-Beta.Leidinger.net (p54A5CFE7.dip.t-dialin.net [84.165.207.231]) (authenticated bits=0) by www.ebusiness-leidinger.de (8.13.6/8.13.6) with ESMTP id k5OERUMD093813; Sat, 24 Jun 2006 16:27:30 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from Magellan.Leidinger.net (Magellan.Leidinger.net [192.168.1.1]) by Andro-Beta.Leidinger.net (8.13.4/8.13.3) with ESMTP id k5OEXH1g080106; Sat, 24 Jun 2006 16:33:17 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Date: Sat, 24 Jun 2006 16:33:59 +0200 From: Alexander Leidinger To: Doug Barton Message-ID: <20060624163359.3ce9398e@Magellan.Leidinger.net> In-Reply-To: <449C7A9C.2000009@FreeBSD.org> References: <20060623210740.6fb370bd@Magellan.Leidinger.net> <449C7A9C.2000009@FreeBSD.org> X-Mailer: Sylpheed-Claws 2.3.1 (GTK+ 2.8.19; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new Cc: current@freebsd.org Subject: Re: The fortune(6) / random problem (again) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jun 2006 14:33:18 -0000 Quoting Doug Barton (Fri, 23 Jun 2006 16:34:52 -0700): > Alexander Leidinger wrote: > > Hi, > > > > this was discussed a while ago (and I don't remember the ... > > status-quo), but with a recent current I see non-random output of > > fortune when using non standard files: > > I do something vaguely similar to what you're doing, which is to point > fortune at a directory of symlinks to various fortune files (see man page > for why that works). My -current is as of 6/19 and I'm not seeing this > behavior, FYI. (I'd actually be sort of interested to see if you get the > same results using this method as you do specifying files on the command line.) As stated in the initial post, when I specify directories instead of files, I get more random output, but still get one long quote very often (and the long quote should not appear, since I use "-s"). To summarize: - "-s" prints long quotes (more than 25 lines) while it shouldn't - fortune is not very random in choosing a quote > FWIW, I did see problems back when this last came up, but for an entirely > different reason. It turns out that there were stale fortune files in > /usr/share/games/fortune that were causing problems. Depending on your > upgrading habits, you might try something like: > > find /usr/share/games/fortune/ -type f ! -newer /usr/src/README > > and see if anything interesting turns up. Not sure about your other > directories though. I have some old files there. And they don't come with the basesystem, I copied them there. Does this mean that the format of the .dat file (or whatever) changed in fortune? I recreated the .dat files now and it seems that the issue with "-s" is gone now. > Finally, the obvious thing to check would be that your /dev/random device is > being properly seeded. Check 'sysctl kern.random.sys.harvest' and make sure > at least one of those is set to 1. You can also run: % sysctl kern.random.sys.harvest kern.random.sys.harvest.ethernet: 1 kern.random.sys.harvest.point_to_point: 1 kern.random.sys.harvest.interrupt: 1 kern.random.sys.harvest.swi: 0 Can the swi one be enabled now? I think I remember that it may not provide randomness. > rndc-confgen -b512 -c ./rndc-key -a -r/dev/random > multiple times to see if you've got a good supply of random bits. You should > be able to run that command at least 10 times without it blocking. If you > can't, you've got /dev/random issues. Works without problems, I tried more than 10 times. But I'm running a buildkernel in the background ATM, so I should see a lot of interrupts for the random device. I will test later with an idle system. But testing with files instead of directories still gives only one quote. So there's still something wrong. Thanks, Alexander. -- ...and that is how we know the Earth to be banana-shaped. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137