On 21/12/16 14:45, Pavol Cupka wrote:
> so the containers restarted after upgrade to 2.0.6
> 
> do you mind pasting your config?
> 

Sure, here is a config file. It is one of many. None work under 2.0.6
but all work under 2.0.4. I haven't modified these configs in a couple
of years because, until now, they've worked fine for my needs. There may
now be better ways to do things than what I have done here :)

# Use autodev to be compatible with systemd
lxc.autodev = 1
lxc.hook.autodev = /srv/lxc/nitrogen/host/etc/lxc/autodev
# hostname
lxc.utsname = nitrogen
#
# network
#     if the network is not defined then the container
#     will be able to use the host's network
lxc.network.type = veth
#lxc.network.flags = up
lxc.network.link = br0
lxc.network.name = eth0
lxc.network.mtu = 1500
lxc.network.hwaddr = 12:34:0A:00:C8:07
# restrict capabilities (security) see "man capabilities"
lxc.cap.drop = sys_module
#lxc.cap.drop = sys_admin
# only explicit device access
lxc.cgroup.devices.deny = a
#
# Memory Devices
lxc.cgroup.devices.allow = c 1:3 rwm # /dev/null      null stream
lxc.cgroup.devices.allow = c 1:5 rwm # /dev/zero      zero stream
lxc.cgroup.devices.allow = c 1:7 rwm # /dev/full      full stream
lxc.cgroup.devices.allow = c 1:8 rwm # /dev/urandom   blocking random stream
lxc.cgroup.devices.allow = c 1:9 rwm # /dev/random    non blocking stream
#
# Terminals
lxc.tty = 1               #                allow this many ttys
lxc.pts = 1024                       #                private instance
of /dev/pts
lxc.cgroup.devices.allow = c 4:0 rwm # /dev/tty0      current virtual
terminal
lxc.cgroup.devices.allow = c 5:0 rwm # /dev/tty       current tty device

lxc.cgroup.devices.allow = c 5:1 rwm # /dev/console   system console
lxc.cgroup.devices.allow = c 5:2 rwm   # /dev/ptmx    pseudo terminal
creator
lxc.cgroup.devices.allow = c 136:* rwm # /dev/pts/*   psuedo terminal slaves
#
# root filesystem
lxc.rootfs = /srv/lxc/nitrogen
# bind mount the host's pacman cache so container uses the same cache
# rather than wasting time downloading packages already downloaded.
lxc.mount.entry = /var/cache/pacman/pkg
/srv/lxc/nitrogen/var/cache/pacman/pkg none rw,bind 0 0
# Build files
lxc.mount.entry = /dev/platters/build /srv/lxc/nitrogen/home/build ext4
defaults 0 0
# Allow access to LVM filesystem
lxc.cgroup.devices.allow = b 254:* rwm # /dev/mapper/* LVM partitions
# transfer
lxc.mount.entry = /srv/transfer /srv/lxc/nitrogen/srv/transfer none
rw,bind 0 0
# 32 bit schroot
lxc.mount.entry = /srv/lxc/nitrogen32 /srv/lxc/nitrogen/opt/nitrogen32
none rw,bind 0 0
lxc.rootfs = /srv/lxc/nitrogen



When I start this config on 2.0.6 I get this output:


lxc@nitrogen.service - LXC Container nitrogen
   Loaded: loaded (/etc/systemd/system/lxc@.service; enabled; vendor
preset: disabled)
   Active: failed (Result: exit-code) since Wed 2016-12-21 15:06:46 GMT;
1min 19s ago
  Process: 10158 ExecStop=/usr/bin/lxc-stop -n %i (code=exited,
status=1/FAILURE)
  Process: 10153 ExecStart=/usr/bin/screen -dmS systemd-%i
/usr/bin/lxc-start -F -n %i (code=exited, status=0/SUCCESS)
 Main PID: 10154 (code=exited, status=0/SUCCESS)

Dec 21 15:06:46 hydrogen systemd[1]: Starting LXC Container nitrogen...
Dec 21 15:06:46 hydrogen systemd[1]: Started LXC Container nitrogen.
Dec 21 15:06:46 hydrogen lxc-stop[10158]: lxc-stop: parse.c:
lxc_file_for_each_line: 57 Failed to parse config: lxc.tty = 1
    #                allow this many tty
Dec 21 15:06:46 hydrogen lxc-stop[10158]: Error opening container
Dec 21 15:06:46 hydrogen systemd[1]: lxc@nitrogen.service: Control
process exited, code=exited status=1
Dec 21 15:06:46 hydrogen systemd[1]: lxc@nitrogen.service: Unit entered
failed state.
Dec 21 15:06:46 hydrogen systemd[1]: lxc@nitrogen.service: Failed with
result 'exit-code'.



If I try to start it without systemd the result is the same:

$ sudo /usr/bin/lxc-start -F -n nitrogen
lxc-start: parse.c: lxc_file_for_each_line: 57 Failed to parse config:
lxc.tty = 1               #                allow this many ttys

lxc-start: tools/lxc_start.c: main: 279 Failed to create lxc_container


The containers start without issue after downgrading like this:

$ sudo pacman -U /var/cache/pacman/pkg/lxc-1:2.0.4-2-x86_64.pkg.tar.xz




Let me know if I can provide anything else.

_______________________________________________
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Reply via email to