[lxc-users] Stopping container changes mount on /dev/ptys???

steve at linuxsuite.org steve at linuxsuite.org
Wed Jul 6 18:20:45 UTC 2016


      Interesting problem... after stopping a container ..  sometimes
restarting it hangs
after some messing around discovered that the permissions on /dev/pts
were changed to ro??!!!!   Moderately reproducable.

       Happens after shutdown in container and using lxc-stop

   Looks like this issue??


[root at lxc100 admn-101]#lxc-start.sh -n admn-101
[root at lxc100 admn-101]#
[root at lxc100 admn-101]# cat /proc/mounts |grep pts
devpts /dev/pts devpts ro,seclabel,relatime,mode=600,ptmxmode=000 0 0
[root at lxc100 admn-101]# mount -oremount,rw /dev/pts
[root at lxc100 admn-101]# cat /proc/mounts |grep pts
devpts /dev/pts devpts rw,seclabel,relatime,gid=5,mode=620,ptmxmode=000 0 0
[root at lxc100 admn-101]# lxc-start -n admn-101
[root at lxc100 admn-101]#

                This has happened a few times. Changing the mount back to
rw fixes it.
Discovered it doing an strace on perhaps related issue with ssh which looks
like this issue??


  strace /usr/sbin/sshd -d

munmap(0x7f400fe0d000, 4096)            = 0
chown("/dev/pts/0", 0, 5)               = -1 EROFS (Read-only file system)
child_tidptr=0x7f400fdfca90) = 22329
wait4(22329, [{WIFEXITED(s) && WEXITSTATUS(s) == 3}], 0, NULL) = 22329
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=22329,
si_status=3, si_utime=0, si_stime=1} ---
close(5)                                = 0
write(2, "openpty: Permission denied\r\n", 28openpty: Permission denied
) = 28

Sure enough, devpts was indeed readonly. Under normal circumstances (e.g.,
on my PC) it is read-write.

  # cat /proc/mounts | grep devpts
  devpts /dev/pts devpts ro,seclabel,relatime,mode=600,ptmxmode=000 0 0

                  Is this issue fixed in 2.x??


More information about the lxc-users mailing list