]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
centos template: prevent mingetty from calling vhangup(2)
authorClaudio Alarcon-Reyes <clalarco@gmail.com>
Fri, 11 Jul 2014 15:32:32 +0000 (11:32 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 15 Jul 2014 00:22:39 +0000 (20:22 -0400)
When using unprivileged containers, tty fails because of vhangup. Adding
--nohangup to nimgetty, it fixes the issue. This is the same problem
occurred for oracle template, commit 2e83f7201c5d402478b9849f0a85c62d5b9f1589

Signed-off-by: Claudio Alarcon clalarco@gmail.com
templates/lxc-centos.in

index 21fad854f81b9e039cf709d3b15553ba707d7884..38c589b1456d73627ea894d59293d813ad2a6269 100644 (file)
@@ -299,7 +299,10 @@ exit 0
 EOF
         chmod 755 $rootfs_path/etc/rc.d/lxc.sysinit
         sed -i 's|si::sysinit:/etc/rc.d/rc.sysinit|si::bootwait:/etc/rc.d/lxc.sysinit|'  $rootfs_path/etc/inittab
-        sed -i 's|^1:|co:2345:respawn:/sbin/mingetty console\n1:|' $rootfs_path/etc/inittab
+        # prevent mingetty from calling vhangup(2) since it fails with userns.
+        # Same issue as oracle template: prevent mingetty from calling vhangup(2)
+        # commit 2e83f7201c5d402478b9849f0a85c62d5b9f1589.
+        sed -i 's|^1:|co:2345:respawn:/sbin/mingetty --nohangup console\n1:|' $rootfs_path/etc/inittab
         sed -i 's|^\([56]:\)|#\1|' $rootfs_path/etc/inittab
     fi
 
@@ -339,6 +342,11 @@ EOF
     echo "# For libvirt/Virtual Machine Monitor" >>${rootfs_path}/etc/securetty
     echo "pts/0"        >>${rootfs_path}/etc/securetty
 
+    # prevent mingetty from calling vhangup(2) since it fails with userns.
+    # Same issue as oracle template: prevent mingetty from calling vhangup(2)
+    # commit 2e83f7201c5d402478b9849f0a85c62d5b9f1589.
+    sed -i 's|mingetty|mingetty --nohangup|' $container_rootfs/etc/init/tty.conf
+
     if [ ${root_display_password} = "yes" ]
     then
         echo "Setting root password to '$root_password'"