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

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

In article <87he9xd5sf.fsf@mrvn.homelinux.org>,
Goswin Brederlow  <goswin.brederlow@student.uni-tuebingen.de> wrote:
>miquels@cistron-office.nl (Miquel van Smoorenburg) writes:
>> No it doesn't, because for example mount does this:
>> fd = open("/etc/mtab.TMP", O_RDWR|O_CREATE, 0666);
>> write(fd, "/dev/hda / ext3 ...", 100);
>> close(fd);
>> rename("/etc/mtab.TMP", "/etc/mtab");
>> That isn't going to work with a state fs.
>Maybe mount and ifup/down could be changed to use /dev/shm
>optionally (maybe via symlink).

Sure, by all means, teach mount to readlink() the symlink and
work in the destination directory of the symlink. Ditto for

>If everyone can live with that, especially the sysvinit maintainer who
>has to include the changes to prepare /dev/shm for this

You mean mount /dev/shm early if it's in fstab

>I'm willing
>to write some patches to utilize /dev/shm for this.

As above, fix mount and ifup/down to follow symlinks. Or, teach
them to check for /run and use /run instead of /etc if it is present.

If the sysvinit maintainer then just changes the bootup scripts
to mount tmpfs-based filesystems as early in the boot process
as possible, we're basically done.

If you have a read-only rootfs it's then simply:

- use a 2.4 kernel or later with tmpfs support
- mount tmpfs on /dev/shm or /run or whatever you like
  using /etc/fstab
- make /etc/mtab a symlink to /dev/shm/fstab or /run/fstab

Et voila.

If that works we can later discuss if it would be a good idea
to make Debian use /run (or /whatever) by default on new installs.

Anyone who is capable of getting themselves made President should
on no account be allowed to do the job -- Douglas Adams.

Reply to: