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

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



miquels@cistron-office.nl (Miquel van Smoorenburg) writes:

> In article <[🔎] 87adftsgsm.fsf@mrvn.homelinux.org>,
> Goswin Brederlow  <goswin.brederlow@student.uni-tuebingen.de> wrote:
> >Providing a state fs that you mount in place of a file would solve all
> >the problems without any change in userspace software. I think thats
> >still the best aproach.
> 
> 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.
> 
> Besides, you can already mount things in place of a file. Create a file
> in /dev/shm, and bind-mount it over a file in /etc. Works fine. But
> it isn't enough, since it will not work with the above.

One would have to make that work. That would be the hard part for a
state fs.

Maybe mount and ifup/down could be changed to use /dev/shm
optionally (maybe via symlink).

If everyone can live with that, especially the sysvinit maintainer who
has to include the changes to prepare /dev/shm for this, I'm willing
to write some patches to utilize /dev/shm for this.

MfG
        Goswin



Reply to: