[lxc-devel] call to setup_dev_symlinks with lxc.autodev

Michael H. Warfield mhw at WittsEnd.com
Tue Apr 15 23:35:23 UTC 2014


On Mon, 2014-04-14 at 15:18 +0200, William Dauchy wrote:
> Hello,

> I'm looking for a way to not execute setup_dev_symlinks. In my case I'm
> using lxc-start with a read only filesystem.
> so:
> !lxc_conf->is_execute && setup_dev_symlinks(&lxc_conf->rootfs))
> will probably fail

> I saw there was:
>                ret = symlink(d->oldpath, path);
>                if (ret && errno != EEXIST) { }
> but in my case I need to manually access the /dev directory in order to
> make it return EEXIST.

If I recall the discussion some time ago, those 4 symlinks (fd, stdin,
stdout, and stderr) are mandatory according to the Linux kernel
documentation.  Sounds like your read-only file system is not set up
properly.  Is there some reason why you can not properly fix that ro-fs
permanently so you don't have to go back and access it manually?

> I was wondering if we could avoid setup_dev_symlinks call in case of
> autodev = 0 for example?

The issue actually came up in another context and not just in the
autodev case.  An application was failing due to the absence of those
symlinks and our attention was called to the failure and the documented
requirement.  Not calling it if autodev == 0 would not necessarily be
appropriate.

Dwight wrote the patch (which I would have otherwise) and there are some
templates which are not setting those symlinks up correctly even though
they don't use autodev and the container startup is not setting them up.
Some distro's create those symlinks in their initramfs, which is never
run in the case of LXC containers.  That has caused some problems.  In
that discussion, it was decided to do it in the startup code.

Serge is asking Dwight if he has any objections to merely returning
non-fatally on an error.  I have a pony in this race as well because
some of my templates (CentOS and legacy Fedora) are also affected.  I
would object to not calling that function in the autodev == 0 case.

I have no objections to merely returning non-fatally on the error as
long as it's understood that you are in a non-supported case where
mandatory symlinks are missing from your /dev directory and
indeterminant errors may result.  If it subsequently fails, it's not our
fault.  We were trying to follow the rules according to the Linux kernel
documentation.

> Thanks,

Regards,
Mike
-- 
Michael H. Warfield (AI4NB) | (770) 978-7061 |  mhw at WittsEnd.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140415/db60241d/attachment.sig>


More information about the lxc-devel mailing list