Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Sep 2008 20:31:35 -0700
From:      Jeremy Chadwick <koitsu@FreeBSD.org>
To:        Joshua Piccari <jpiccari@bblocked.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Temp files in /etc
Message-ID:  <20080906033135.GA73919@icarus.home.lan>
In-Reply-To: <15d3bc360809051940t70f0b884mb9a80132acc50b45@mail.gmail.com>
References:  <15d3bc360809051940t70f0b884mb9a80132acc50b45@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080906033135.GA73919>