From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 6 03:41:40 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1097D106566C for ; Sat, 6 Sep 2008 03:41:40 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA09.westchester.pa.mail.comcast.net (qmta09.westchester.pa.mail.comcast.net [76.96.62.96]) by mx1.freebsd.org (Postfix) with ESMTP id 9C0838FC1B for ; Sat, 6 Sep 2008 03:41:39 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA03.westchester.pa.mail.comcast.net ([76.96.62.27]) by QMTA09.westchester.pa.mail.comcast.net with comcast id BE5G1a0090bG4ec59FXczH; Sat, 06 Sep 2008 03:31:37 +0000 Received: from koitsu.dyndns.org ([67.180.253.227]) by OMTA03.westchester.pa.mail.comcast.net with comcast id BFXb1a00G4v8bD73PFXcqn; Sat, 06 Sep 2008 03:31:36 +0000 X-Authority-Analysis: v=1.0 c=1 a=QycZ5dHgAAAA:8 a=nxR78qaYifMxGTBnaiQA:9 a=tDLl8M4CBEE2RJB4J3gJiiAoJv0A:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id 8B54917B81A; Fri, 5 Sep 2008 20:31:35 -0700 (PDT) Date: Fri, 5 Sep 2008 20:31:35 -0700 From: Jeremy Chadwick To: Joshua Piccari Message-ID: <20080906033135.GA73919@icarus.home.lan> References: <15d3bc360809051940t70f0b884mb9a80132acc50b45@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15d3bc360809051940t70f0b884mb9a80132acc50b45@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-hackers@freebsd.org Subject: Re: Temp files in /etc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2008 03:41:40 -0000 On Fri, Sep 05, 2008 at 07:40:13PM -0700, Joshua Piccari wrote: > Hi all, > I am setting up a few jails and I want them all to use the same /etc files > (with the exception of the files related to the password files and > databases), so I mounted a shared /etc folder as a nullfs with read-only > permissions. The problem is that using utilities like pw or chpass create > temporary files in /etc and that file system is mounted read-only. > So is there a way to force any utilities that create temp files in /etc to > use another location, something like /usr/local/etc for example? It depends entirely on how each individual program makes temporary files; there is no "standard". libc offers a many different methods of creating temporary files: tmpfile(3), tmpnam(3), tempnam(3), mktemp(3), and mkstemp(3). You can read the manpages to get an idea of how chaotic the situation is. Other programs may implement their own temporary file creation methods entirely, and may/may not support TMPDIR. I would try export TMPDIR="/some/place" and then attempt using pw and chpass, and see what happens. If they still attempt to use /tmp, said programs could probably be modified to support TMPDIR. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |