This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat /tmp/lxc.log | |
lxc-create 1391628487.880 WARN lxc_log - lxc_log_init called with log already initialized | |
lxc-create 1391628487.893 INFO bdev - got 0 for thin pool at path: /dev/lxc/lxc | |
lxc-create 1391628487.962 DEBUG bdev - trying to mount '/dev/lxc/test'->'/usr/lib/lxc/rootfs' with fstype 'ext3' | |
lxc-create 1391628487.963 INFO bdev - mounted '/dev/lxc/test' on '/usr/lib/lxc/rootfs', with fstype 'ext3' | |
lxc-create 1391628487.983 INFO lxc_create_ui - container test created | |
lxc-start 1391628487.988 INFO lxc_start_ui - using rcfile /var/lib/lxc/test/test/config | |
lxc-start 1391628487.988 WARN lxc_log - lxc_log_init called with log already initialized | |
lxc-start 1391628487.988 ERROR lxc_start_ui - Executing '/sbin/init' with no configuration file may crash the host |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo lxc-destroy -n test | |
lxc_container: _recursive_rmdir_onedev: failed to delete /var/lib/lxc/test/rootfs/run/shm | |
lxc_container: _recursive_rmdir_onedev: failed to delete /var/lib/lxc/test/rootfs/run | |
lxc_container: _recursive_rmdir_onedev: failed to delete /var/lib/lxc/test/rootfs/sbin | |
lxc_container: _recursive_rmdir_onedev: failed to delete /var/lib/lxc/test/rootfs/lib | |
lxc_container: _recursive_rmdir_onedev: failed to delete /var/lib/lxc/test/rootfs/dev | |
lxc_container: _recursive_rmdir_onedev: failed to delete /var/lib/lxc/test/rootfs/lib64 | |
lxc_container: _recursive_rmdir_onedev: failed to delete /var/lib/lxc/test/rootfs/bin | |
lxc_container: _recursive_rmdir_onedev: failed to delete /var/lib/lxc/test/rootfs/proc | |
lxc_container: _recursive_rmdir_onedev: failed to delete /var/lib/lxc/test/rootfs/etc/init.d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo lxc-create -t sshd -n test -f /var/lib/lxc/test/config -l DEBUG -o /tmp/lxc.log &> /dev/null | |
$ sudo lxc-start -d -n test -f /var/lib/lxc/test/config -P /var/lib/lxc/test -l DEBUG -o /tmp/lxc.log | |
$ cat /tmp/lxc.log | |
lxc-create 1391637847.305 WARN lxc_log - lxc_log_init called with log already initialized | |
lxc-start 1391637853.096 WARN lxc_log - lxc_log_init called with log already initialized | |
lxc-start 1391637853.099 DEBUG lxc_cgroup - cgroup_init | |
lxc-start 1391637853.099 INFO lxc_cgroup - Initialized cgroup driver cgroupfs | |
lxc-start 1391637853.099 INFO lxc_lsm - LSM security driver SELinux | |
lxc-start 1391637853.099 DEBUG lxc_start - sigchild handler set | |
lxc-start 1391637853.100 DEBUG lxc_console - no console peer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# lxc: linux Container library | |
# Authors: | |
# Daniel Lezcano <[email protected]> | |
# This library is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU Lesser General Public |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat /tmp/lxc.log | |
lxc-create 1392051349.564 WARN lxc_log - lxc_log_init called with log already initialized | |
lxc-create 1392051349.588 INFO lxc_create_ui - container test created | |
lxc-start 1392051366.650 INFO lxc_start_ui - using rcfile /var/lib/lxc/test/config | |
lxc-start 1392051366.650 WARN lxc_log - lxc_log_init called with log already initialized | |
lxc-start 1392051366.652 DEBUG lxc_cgroup - cgroup_init | |
lxc-start 1392051366.652 INFO lxc_cgroup - Initialized cgroup driver cgroupfs | |
lxc-start 1392051366.652 INFO lxc_lsm - LSM security driver SELinux | |
lxc-start 1392051366.653 DEBUG lxc_start - sigchild handler set | |
lxc-start 1392051366.653 DEBUG lxc_console - no console peer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# lxc: linux Container library | |
# Authors: | |
# Daniel Lezcano <[email protected]> | |
# Nels Nelson <[email protected]> | |
# This library is free software; you can redistribute it and/or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# First attempt without apparmor | |
# | |
# lxc-create -n outer -t minimal | |
# ls /var/lib/lxc/outer/rootfs | |
bin dev etc home lib lib64 proc root run run-dhcp sbin sys tmp usr var | |
# ls /var/lib/lxc/outer/rootfs/sys | |
# lxc-start -n outer -- bash | |
bash: cannot set terminal process group (-1): Inappropriate ioctl for device |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Detect use under userns (unsupported) | |
for arg in "$@"; do | |
[ "$arg" = "--" ] && break | |
if [ "$arg" = "--mapped-uid" -o "$arg" = "--mapped-gid" ]; then | |
echo "This template can't be used for unprivileged containers." 1>&2 | |
echo "You may want to try the \"download\" template instead." 1>&2 | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash-4.2# pwd | |
/sys/fs/cgroup | |
bash-4.2# ls | |
blkio cpu cpuacct cpuset devices freezer hugetlb hugetlb,net_prio,perf_event,blkio,freezer,devices,memory,cpuacct,cpu,cpuset memory net_prio perf_event | |
bash-4.2# ls -la | |
total 0 | |
drwxr-xr-x. 3 root root 260 Apr 9 21:13 . | |
drwxr-xr-x. 7 root root 0 Apr 9 21:13 .. | |
lrwxrwxrwx. 1 root root 75 Apr 9 21:13 blkio -> hugetlb,net_prio,perf_event,blkio,freezer,devices,memory,cpuacct,cpu,cpuset | |
lrwxrwxrwx. 1 root root 75 Apr 9 21:13 cpu -> hugetlb,net_prio,perf_event,blkio,freezer,devices,memory,cpuacct,cpu,cpuset |