Re: ifupdown writes to /etc... a bug?
In article <firstname.lastname@example.org>,
Goswin Brederlow <email@example.com> wrote:
>firstname.lastname@example.org (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);
>> 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
>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
- make /etc/mtab a symlink to /dev/shm/fstab or /run/fstab
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.