[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ifupdown writes to /etc... a bug?


On Mon, Mar 10, 2003 at 03:03:18PM +0000, Miquel van Smoorenburg wrote:

> Perhaps it is time for a /var/bootstate (with a better name though)
> on which during early boot a shmfs is mounted, and as soon as
> /var becomes available for mounting is copied over to the real
> /var/bootstate and unmounted.
> On shutdown this should be reversed ofcourse, so a seperate
> directory /var/bootstate is needed - you can't copy /var/state
> to shmfs in its entirity, it would potentially be way to big.

Good idea, but why copy it over and unmount it at startup instead of

I use something like that on my notebook to prevent things like ntpd's
drift file from spinning up the disk all the time: I have /tmp as ext2
on a ramdisk (could just as well be shmfs though) and have a
/tmp/preserved which I create from /var/tmp-preserved at bootup and copy
back to /var/tmp-preserved at shutdown, and have /var/lib/ntp symlinked
to /var/tmp-preserved/ntp.

Of course, using /tmp in such a way goes a bit far, but why not do it
like this then:

* keep /tmp as it is now;
* keep /var as it is now;
* add /mem, which is RAM-based, writable /very/ early, and initialised
  in full from /var/mem at bootup, allowing the admin to define a desired
  initial state;
* have part of it, eg. /mem/preserved, written back to /var/mem/preserved at

Pidfiles, locks, ifstate, dhcp stuff, mtab, etc. that now need cleaning
up at boot time would be perfect candidates for /mem, things like
ntp.drift could go in /mem/preserved, and some parts parts of /var/state
could be moved to either.

This is good for your disks, good for your batteries, simplifies state
cleanup at startup, and solves the writable-etc-or-no-networked-var
issue with ifstate to boot.

It "just" needs to be added to FHS. 

I think /mem/ is cleaner than /var/mem, because the latter either
requires /var to be already mounted readonly, which sort of defeats the
purpose, or a lot of messy and fragile data movements at startup. 



E-Advies / Emile van Bergen   |   emile@e-advies.nl
tel. +31 (0)70 3906153        |   http://www.e-advies.nl

Attachment: pgpohJ3lCD19T.pgp
Description: PGP signature

Reply to: