From 7e40254ab7e85bca548948c3fa02c6ed0169ec73 Mon Sep 17 00:00:00 2001 From: Jean-Tiare LE BIGOT Date: Sat, 2 Aug 2014 15:27:13 +0200 Subject: [PATCH] Ensure /dev/pts directory exists on pts setup MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When `lxc.autodev = 0` and empty tmpfs is mounted on /dev and private pts are requested, we need to ensure '/dev/pts' exists before attempting to mount devpts on it. Signed-off-by: Jean-Tiare LE BIGOT Acked-by: Stéphane Graber --- src/lxc/conf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 799f011f0..237bad4bc 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1605,6 +1605,13 @@ static int setup_pts(int pts) return -1; } + if (mkdir("/dev/pts", 0755)) { + if ( errno != EEXIST ) { + SYSERROR("failed to create '/dev/pts'"); + return -1; + } + } + if (mount("devpts", "/dev/pts", "devpts", MS_MGC_VAL, "newinstance,ptmxmode=0666,mode=0620,gid=5")) { SYSERROR("failed to mount a new instance of '/dev/pts'"); -- 2.47.2