Exiting jhalfs cleanly

Bruce Dubbs bruce.dubbs at gmail.com
Sun Dec 30 09:41:02 PST 2012

Pierre Labastie wrote:
> Hi,
> Thank you very much for answering
> Le 30/12/2012 16:19, xinglp a écrit :
>> Tihere is also a directory created by lfs book by the below script may
>> be need cleanup.
>> if [ -h $LFS/dev/shm ]; then
>>     link=$(readlink $LFS/dev/shm)
>>     mkdir -p $LFS/$link
>>     mount -vt tmpfs shm $LFS/$link
>>     unset link
>> else
>>     mount -vt tmpfs shm $LFS/dev/shm
>> fi

> That is not so straightforward, because the directory $link might as
> well be created during '6.5-Creating directories'. We do not want to
> remove it in that case. And if (as is the most probable) we stay with
> a subdirectory of /run, it is harmless, since the bootscripts mount
> a tmpfs on /run.

There are only two cases that I'm aware of: a /dev/shm mount point and a 
link from /dev/shm to /run/shm whee /run/shm is a mount point.

In an imperfect world, if the /dev/shm link points to a completely 
arbitrary and inappropriate location, let's say /usr, then that would be 
a problem.  It would be a problem even if we didn't remove the mounted 
tmpfs.  The book should handle normal and reasonable cases and not worry 
about pathological cases.

   -- Bruce

More information about the alfs-discuss mailing list