[libvirt] [PATCH] Populate /dev/std{in, out, err} symlinks in LXC containers

Eric Blake eblake at redhat.com
Wed Feb 8 15:01:53 UTC 2012


On 02/08/2012 07:22 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> Some applications expect /dev/std{in,out,err} to exist. Populate
> them during container startup as symlinks to /proc/self/fd
> ---
>  src/lxc/lxc_container.c |   17 +++++++++++++++++
>  1 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
> index 04af39b..cb51bbc 100644
> --- a/src/lxc/lxc_container.c
> +++ b/src/lxc/lxc_container.c
> @@ -584,6 +584,14 @@ static int lxcContainerPopulateDevices(char **ttyPaths, size_t nttyPaths)
>          { LXC_DEV_MAJ_MEMORY, LXC_DEV_MIN_RANDOM, 0666, "/dev/random" },
>          { LXC_DEV_MAJ_MEMORY, LXC_DEV_MIN_URANDOM, 0666, "/dev/urandom" },
>      };
> +    const struct {
> +        const char *src;
> +        const char *dst;
> +    } links[] = {
> +        { "/proc/self/fd/0", "/dev/stdin" },
> +        { "/proc/self/fd/1", "/dev/stdout" },
> +        { "/proc/self/fd/2", "/dev/stderr" },
> +    };

I think you also need a row for:

 { "/proc/self/fd", "/dev/fd" },

ACK with that addition.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120208/b46a734d/attachment-0001.sig>


More information about the libvir-list mailing list