Skip to content

Commit 261668f

Browse files
author
Mike Savochkin
authored
Merge pull request #1022 from subutai-io/dev
Dev
2 parents 918f932 + f3f4ca2 commit 261668f

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

debian/postinst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ if systemctl is-active --quiet ipfs.service; then
1616
ipfs bootstrap add /dnsaddr/eu1.s.optdyn.com/ipfs/QmUZFuJ31ctYGxYFDtKzDBXmpmiBQWZGyqQChL7RwQNitV
1717
ipfs bootstrap add /dnsaddr/us1.s.optdyn.com/ipfs/QmdL6K8gqGT2BRUEGtcnRGTCyGVV5H7QiYqPLzvgMcLpxo
1818
fi
19+
20+
# Restart apparmor
21+
systemctl restart apparmor
22+

debian/rules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,18 @@ override_dh_auto_install:
2222
dh_auto_install -- --no-source
2323
mv debian/subutai/usr/bin/agent debian/subutai/usr/bin/subutai
2424
mkdir -p debian/subutai/etc/subutai/
25+
mkdir -p debian/subutai/etc/apparmor.d/lxc
2526
mkdir -p debian/subutai/var/lib/subutai/
2627
mkdir -p debian/subutai/usr/sbin
2728
mkdir -p debian/subutai/usr/lib/subutai/libexec
2829
mkdir -p debian/subutai/usr/lib/subutai/etc
30+
mkdir -p debian/subutai/usr/share/subutai/config
2931
mkdir -p debian/subutai/usr/share/bash-completion/completions
3032
mkdir -p debian/subutai/lib/systemd/system
3133
cp debian/tree/agent.conf debian/subutai/etc/subutai/
3234
cp debian/tree/agent.conf debian/subutai/usr/lib/subutai/etc/
35+
cp debian/tree/lxc-default-subutai debian/subutai/etc/apparmor.d/lxc/
36+
cp debian/tree/subutai.conf debian/subutai/usr/share/subutai/config/
3337
cp debian/tree/libexec/* debian/subutai/usr/lib/subutai/libexec/
3438
cp debian/tree/ssh.pem debian/subutai/var/lib/subutai/
3539
cp debian/tree/sbin/* debian/subutai/usr/sbin/

debian/tree/lxc-default-subutai

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Do not load this file. Rather, load /etc/apparmor.d/lxc-containers, which
2+
# will source all profiles under /etc/apparmor.d/lxc
3+
4+
profile lxc-container-default-subutai flags=(attach_disconnected,mediate_deleted) {
5+
#include <abstractions/lxc/container-base>
6+
#include <abstractions/lxc/start-container>
7+
deny mount fstype=devpts,
8+
mount fstype=cgroup -> /sys/fs/cgroup/**,
9+
mount fstype=cgroup2 -> /sys/fs/cgroup/**,
10+
mount options=(rw,bind),
11+
mount options=(rw,rbind),
12+
mount options=(rw,rshared),
13+
mount options=(ro,nosuid,noexec,remount,bind,strictatime),
14+
}

debian/tree/subutai.conf

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This derives from the global common config
2+
lxc.include = /usr/share/lxc/config/common.conf
3+
4+
# Doesn't support consoles in /dev/lxc/
5+
lxc.tty.dir =
6+
7+
# When using LXC with apparmor, the container will be confined by default.
8+
# If you wish for it to instead run unconfined, copy the following line
9+
# (uncommented) to the container's configuration file.
10+
#lxc.apparmor.profile = unconfined
11+
lxc.apparmor.profile = lxc-container-default-subutai
12+
13+
# If you wish to allow mounting block filesystems, then use the following
14+
# line instead, and make sure to grant access to the block device and/or loop
15+
# devices below in lxc.cgroup.devices.allow.
16+
#lxc.apparmor.profile = lxc-container-default-with-mounting
17+
lxc.mount.entry = /dev/fuse dev/fuse none bind,create=file
18+
19+
# Extra cgroup device access
20+
## rtc
21+
lxc.cgroup.devices.allow = c 254:0 rm
22+
## tun
23+
lxc.cgroup.devices.allow = c 10:200 rwm
24+
## hpet
25+
lxc.cgroup.devices.allow = c 10:228 rwm
26+
## kvm
27+
lxc.cgroup.devices.allow = c 10:232 rwm
28+
## To use loop devices, copy the following line to the container's
29+
## configuration file (uncommented).
30+
#lxc.cgroup.devices.allow = b 7:* rwm

0 commit comments

Comments
 (0)