From owner-freebsd-current@FreeBSD.ORG Mon Apr 26 09:43:32 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 B081016A4CE for ; Mon, 26 Apr 2004 09:43:32 -0700 (PDT) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9287843D4C for ; Mon, 26 Apr 2004 09:43:32 -0700 (PDT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.9p1/8.12.8) with ESMTP id i3QGhVgd048140; Mon, 26 Apr 2004 09:43:31 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.9p1/8.12.3/Submit) id i3QGhVdW048139; Mon, 26 Apr 2004 09:43:31 -0700 (PDT) (envelope-from rizzo) Date: Mon, 26 Apr 2004 09:43:31 -0700 From: Luigi Rizzo To: current@freebsd.org Message-ID: <20040426094331.A47077@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Subject: running pwd_mkdb from the startup scripts ? 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: Mon, 26 Apr 2004 16:43:32 -0000 does anyone know what is a good place to run /usr/sbin/pwd_mkdb from the startup scripts ? Alternatively, can I put a hook in /etc/rc to run it if so specified by rc.conf ? (i am interested in doing that for diskless environments, but the problem is general). A good place i have seen is at the end of rc.diskless2 (or the equivalent in -current), or at the beginning of rc.sysctl, but that requires to override the entire file just to add one line. Starting from rc.local or local_startup scripts is too late because some daemons need a valid user database to work; starting from /etc/rc.early is too early because /usr is not mounted yet. The problem is, if the [s]pwd.db and [master.]passwd files are out of sync, the system trusts the binary version and not the one-true-source which would be master.passwd, so in certain cases it would be nice to have them resynced automatically at boot time cheers luigi