Skip to content

Instantly share code, notes, and snippets.

@nelsnelson
Created April 4, 2014 16:42
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nelsnelson/9978457 to your computer and use it in GitHub Desktop.
Nested container failure example
#! /usr/bin/env bash
exec &>/dev/null
sudo lxc-stop -n outer -t 5
sudo lxc-destroy -n outer
exec &>/dev/tty
set -x
sudo lxc-create -n outer -t minimal -l DEBUG -o /tmp/lxc.log
sudo lxc-start -n outer -d -l DEBUG -o /tmp/lxc.log
sudo lxc-attach -n outer -l DEBUG -o /tmp/lxc.log -- lxc-create -n inner -t minimal -l DEBUG -o /tmp/lxc.log
set +x
cat /tmp/lxc.log
sudo rm -f /tmp/lxc.log
sudo lxc-stop -n outer -t 5
sudo lxc-destroy -n outer
$ ./lxc-nested.sh
+ sudo lxc-create -n outer -t minimal -l DEBUG -o /tmp/lxc.log
+ sudo lxc-start -n outer -d -l DEBUG -o /tmp/lxc.log
+ sudo lxc-attach -n outer -l DEBUG -o /tmp/lxc.log -- lxc-create -n inner -t minimal -l DEBUG -o /tmp/lxc.log
lxc-create: No such file or directory - failed to create container path for inner
lxc-create: Error creating container inner
+ set +x
lxc-create 1396562872.789 WARN lxc_log - lxc_log_init called with log already initialized
lxc-create 1396562872.857 INFO lxc_create_ui - container outer created
lxc-start 1396562872.862 INFO lxc_start_ui - using rcfile /var/lib/lxc/outer/config
lxc-start 1396562872.862 WARN lxc_log - lxc_log_init called with log already initialized
lxc-start 1396562872.864 INFO lxc_lsm - LSM security driver SELinux
lxc-start 1396562872.865 DEBUG lxc_start - sigchild handler set
lxc-start 1396562872.865 DEBUG lxc_console - no console peer
lxc-start 1396562872.865 INFO lxc_start - 'outer' is initialized
lxc-start 1396562872.867 INFO lxc_monitor - using monitor sock name lxc/ad055575fe28ddd5//var/lib/lxc
lxc-start 1396562872.872 DEBUG lxc_start - Not dropping cap_sys_boot or watching utmp
lxc-start 1396562872.872 INFO lxc_cgroup - cgroup driver cgroupfs initing for outer
lxc-start 1396562872.875 INFO lxc_conf - 'outer' hostname has been setup
lxc-start 1396562872.875 INFO lxc_conf - network has been setup
lxc-start 1396562872.876 DEBUG lxc_conf - mounted '/var/lib/lxc/outer/rootfs' on '/usr/lib/lxc/rootfs'
lxc-start 1396562872.876 DEBUG lxc_conf - Set exec command to /sbin/init
lxc-start 1396562872.876 INFO lxc_conf - Autodev not required.
lxc-start 1396562872.876 DEBUG lxc_conf - remounting /dev on /usr/lib/lxc/rootfs/dev to respect bind or remount options
lxc-start 1396562872.876 DEBUG lxc_conf - mounted '/dev' on '/usr/lib/lxc/rootfs/dev', type 'none'
lxc-start 1396562872.876 DEBUG lxc_conf - remounting /lib on /usr/lib/lxc/rootfs/lib to respect bind or remount options
lxc-start 1396562872.876 DEBUG lxc_conf - mounted '/lib' on '/usr/lib/lxc/rootfs/lib', type 'none'
lxc-start 1396562872.876 DEBUG lxc_conf - remounting /bin on /usr/lib/lxc/rootfs/bin to respect bind or remount options
lxc-start 1396562872.876 DEBUG lxc_conf - mounted '/bin' on '/usr/lib/lxc/rootfs/bin', type 'none'
lxc-start 1396562872.876 DEBUG lxc_conf - remounting /usr on /usr/lib/lxc/rootfs/usr to respect bind or remount options
lxc-start 1396562872.877 DEBUG lxc_conf - mounted '/usr' on '/usr/lib/lxc/rootfs/usr', type 'none'
lxc-start 1396562872.877 DEBUG lxc_conf - remounting /sbin on /usr/lib/lxc/rootfs/sbin to respect bind or remount options
lxc-start 1396562872.877 DEBUG lxc_conf - mounted '/sbin' on '/usr/lib/lxc/rootfs/sbin', type 'none'
lxc-start 1396562872.877 DEBUG lxc_conf - remounting /usr/share/lxc/templates/lxc-minimal on /usr/lib/lxc/rootfs/sbin/init to respect bind or remount options
lxc-start 1396562872.877 DEBUG lxc_conf - mounted '/usr/share/lxc/templates/lxc-minimal' on '/usr/lib/lxc/rootfs/sbin/init', type 'none'
lxc-start 1396562872.877 DEBUG lxc_conf - mounted 'proc' on '/usr/lib/lxc/rootfs/proc', type 'proc'
lxc-start 1396562872.877 DEBUG lxc_conf - mounted 'sysfs' on '/usr/lib/lxc/rootfs/sys', type 'sysfs'
lxc-start 1396562872.877 DEBUG lxc_conf - remounting /etc/init.d on /usr/lib/lxc/rootfs/etc/init.d to respect bind or remount options
lxc-start 1396562872.877 DEBUG lxc_conf - mounted '/etc/init.d' on '/usr/lib/lxc/rootfs/etc/init.d', type 'none'
lxc-start 1396562872.877 DEBUG lxc_conf - remounting /lib64 on /usr/lib/lxc/rootfs/lib64 to respect bind or remount options
lxc-start 1396562872.877 DEBUG lxc_conf - mounted '/lib64' on '/usr/lib/lxc/rootfs/lib64', type 'none'
lxc-start 1396562872.877 INFO lxc_conf - mount points have been setup
lxc-start 1396562872.877 INFO lxc_conf - console has been setup
lxc-start 1396562872.877 INFO lxc_conf - 0 tty(s) has been setup
lxc-start 1396562872.877 INFO lxc_conf - I am 1, /proc/self points to '1'
lxc-start 1396562872.877 DEBUG lxc_conf - created '/usr/lib/lxc/rootfs/lxc_putold' directory
lxc-start 1396562872.877 DEBUG lxc_conf - mountpoint for old rootfs is '/usr/lib/lxc/rootfs/lxc_putold'
lxc-start 1396562872.877 DEBUG lxc_conf - pivot_root syscall to '/usr/lib/lxc/rootfs' successful
lxc-start 1396562872.877 DEBUG lxc_conf - umounted '/lxc_putold/dev/pts'
lxc-start 1396562872.877 DEBUG lxc_conf - umounted '/lxc_putold/run/lock'
lxc-start 1396562872.877 DEBUG lxc_conf - umounted '/lxc_putold/run/shm'
lxc-start 1396562872.877 DEBUG lxc_conf - umounted '/lxc_putold/sys/fs/selinux'
lxc-start 1396562872.877 DEBUG lxc_conf - umounted '/lxc_putold/sys/fs/cgroup'
lxc-start 1396562872.877 DEBUG lxc_conf - umounted '/lxc_putold/proc'
lxc-start 1396562872.877 DEBUG lxc_conf - umounted '/lxc_putold/var/lib/nfs/rpc_pipefs'
lxc-start 1396562872.877 DEBUG lxc_conf - umounted '/lxc_putold/dev'
lxc-start 1396562872.877 DEBUG lxc_conf - umounted '/lxc_putold/run'
lxc-start 1396562872.877 DEBUG lxc_conf - umounted '/lxc_putold/sys'
lxc-start 1396562872.877 DEBUG lxc_conf - umounted '/lxc_putold'
lxc-start 1396562872.877 INFO lxc_conf - created new pts instance
lxc-start 1396562872.877 DEBUG lxc_conf - drop capability 'sys_module' (16)
lxc-start 1396562872.877 DEBUG lxc_conf - drop capability 'mac_admin' (33)
lxc-start 1396562872.877 DEBUG lxc_conf - drop capability 'mac_override' (32)
lxc-start 1396562872.877 DEBUG lxc_conf - drop capability 'sys_time' (25)
lxc-start 1396562872.877 DEBUG lxc_conf - capabilities have been setup
lxc-start 1396562872.877 NOTICE lxc_conf - 'outer' is setup.
lxc-start 1396562872.877 WARN lxc_start - inherited fd 4
lxc-start 1396562872.877 WARN lxc_start - inherited fd 6
lxc-start 1396562872.877 WARN lxc_start - inherited fd 7
lxc-start 1396562872.877 WARN lxc_start - inherited fd 8
lxc-start 1396562872.877 NOTICE lxc_start - exec'ing '/sbin/init'
lxc-start 1396562872.879 NOTICE lxc_start - '/sbin/init' started with pid '17684'
lxc-start 1396562872.879 WARN lxc_start - invalid pid for SIGCHLD
lxc-start 1396562872.879 DEBUG lxc_commands - peer has disconnected
lxc-start 1396562872.880 DEBUG lxc_commands - 'outer' is in 'RUNNING' state
lxc-start 1396562872.880 DEBUG lxc_commands - peer has disconnected
lxc-start 1396562872.886 DEBUG lxc_commands - peer has disconnected
lxc-attach 1396562872.887 WARN lxc_log - lxc_log_init called with log already initialized
lxc-start 1396562872.887 DEBUG lxc_commands - peer has disconnected
lxc-start 1396562872.887 DEBUG lxc_commands - peer has disconnected
lxc-attach 1396562872.928 WARN lxc_attach - could not change directory to '/home/nels.nelson/src/nested'
lxc-attach 1396562872.929 INFO lxc_lsm_selinux - changed SELinux exec context to unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment