aboutsummaryrefslogtreecommitdiff
path: root/bin/lxc-setup
blob: 08824a8beb86f58ac0c80268f7b83be3a2524ca1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# https://wiki.debian.org/LXC
# https://lists.linuxcontainers.org/pipermail/lxc-devel/2014-February/008088.html
# https://lists.debian.org/debian-user/2015/05/msg00162.html
# https://wiki.debian.org/LXC/SimpleBridge
# http://box.matto.nl/lxconlaptop.html
# https://coderwall.com/p/k0gutq/clean-lxc-nat-configuration-debian-wheezy

for d in /sys/fs/cgroup/*
do
    f=$(basename $d)
    echo "looking at $f"
    if [ "$f" = "cpuset" ]; then
        echo 1 | sudo tee -a $d/cgroup.clone_children;
    elif [ "$f" = "memory" ]; then 
        echo 1 | sudo tee -a $d/memory.use_hierarchy;
    fi
    sudo mkdir $d/$USER
    sudo chown -R $USER: $d/$USER
    echo $$ > $d/$USER/tasks
done