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

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



In article <[🔎] 87adftsgsm.fsf@mrvn.homelinux.org>,
Goswin Brederlow  <goswin.brederlow@student.uni-tuebingen.de> wrote:
>"Marco d'Itri" <md@Linux.IT> writes:
>
>> On Mar 17, Thomas Hood <jdthood0@yahoo.co.uk> wrote:
>> 
>>  >If a consensus is emerging that /run is needed, what's the next
>>  >step?  Amending policy to allow for the directory (currently
>>  >forbidden by FHS)?
>> I do not think there is such a consensus. 

Unfortunately I have to agree. Nothing solid came out of the
discussion, I think. I'm still not sure if I should provide
a /run directory in sysvinit, or not.

>> Many people pointed that after teaching programs like mount to follow
>> symlinks the problem can easily be solved by the local admin.
>
>No it can't and mount already follows symlinks. Thats why linking to
>/proc/mounts works unless you need the extra infos for loopback or
>quota thats stored only in a normal /etc/mtab.

No, mount doesn't follow symlinks correctly. If it sees that mtab
is a symlink it will simply not modify it at all, which is
not what you want. You want mount to follow the symlink if it
doesn't point to /proc and do it's tempfile creation etc in
the directory the link points to.

>Anyway, the problem remains that you need a palce to write data at a
>time when there is no place to write to. No matter where you say it
>should go to you first need to make something writeable.
>
>I don't like the idea of a ramdisk because its eigther too smal or to
>big but never right sized. tmpfs might be suitable but you have to
>adapt software to utilize the place where its mounted or to correctly
>function with symlinks to there.
>
>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.

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



Reply to: