From owner-freebsd-current@FreeBSD.ORG Sun Feb 1 13:44:21 2004 Return-Path: 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 1C07616A4CE for ; Sun, 1 Feb 2004 13:44:21 -0800 (PST) Received: from vimes.aminor.no (vimes.aminor.no [213.187.177.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41F4143D1D for ; Sun, 1 Feb 2004 13:44:19 -0800 (PST) (envelope-from eivind@aminor.no) Received: from [192.168.0.2] (rincewind.eivind [192.168.0.2]) by vimes.aminor.no (Postfix) with ESMTP id 2AB8E17ACB for ; Sun, 1 Feb 2004 22:44:17 +0100 (CET) Date: Sun, 01 Feb 2004 22:46:51 +0100 From: Eivind Olsen To: current@freebsd.org Message-ID: <10344312.1075675611@[192.168.0.2]> X-Mailer: Mulberry/3.1.1 (Win32) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: How to create device nodes in a chroot jail? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Sun, 01 Feb 2004 21:44:21 -0000 Hello. I'm currently running some services in a chroot() and they seem to want to access device nodes in $chroot/dev/ I've previously created the required device nodes with mknod(8) but it looks like this can cause problems. For example, after doing an upgrade from 5.2-RELEASE to 5.2.1-RC the /dev/random device changed its major number from 250 to 249 and named started complaining: Jan 31 10:58:08 vimes named[321]: entropy.c:280: unexpected error: Jan 31 10:58:08 vimes kernel: Jan 31 10:58:08 vimes named[321]: entropy.c:280: unexpected error: Jan 31 10:58:08 vimes named[321]: fcntl(4, F_SETFL, 4): Operation not permitted Jan 31 10:58:08 vimes kernel: Jan 31 10:58:08 vimes named[321]: fcntl(4, F_SETFL, 4): Operation not permitted Jan 31 10:58:08 vimes named[321]: could not open entropy source /dev/random: unexpected error After deleting $chroot/dev/random and recreating it with a new major number named started working as expected again. I am wondering what the best way to do this is in a way that doesn't require me to manually delete+recreate those device nodes every time I recompile the system? Should I for example look into mounting a devfs-filesystem on $chroot/dev/ ? -- Regards / Hilsen Eivind Olsen