The systemd start script of lxc-1.1.0 results in continuous reboots of the guest system with this log message: Feb 14 17:15:28 host systemd[1]: lxc@vser1.service holdoff time over, scheduling restart. The problem seems to be the starting with lxc 1.1.0 the guest system is started in daemon mode per default: https://linuxcontainers.org/lxc/news/ lxc-start: containers now start daemonized by default The following start script (in /usr/lib/systemd/system/lxc@.service) seems to work: [Unit] Description=Linux Container %I After=network.target [Service] Restart=always Type=simple ExecStartPre=/usr/libexec/lxc/lxc-devsetup ExecStart=/usr/sbin/lxc-start -n %i -F ExecReload=/usr/sbin/lxc-restart -n %i ExecStop=/usr/sbin/lxc-stop -n %i [Install] WantedBy=multi-user.target Also I had to set the kernel option (on the host system): MAGIC_SYSRQ This should be fixed in upstream by this bug report/fix: https://github.com/lxc/lxc/issues/425
Hi I think Type=simple is not needed according to http://www.freedesktop.org/software/systemd/man/systemd.service.html Can you test your unit file after you remove that line? Thanks
Upstream also uses "Delegate=yes" which I think we should do as well.
You are right, Type=simple seems not necessary. But the option -F for starting in non-daemon mode.
I committed the following fix in the 1.1.0-r1 ebuild Thanks --- files/lxc_at.service 2014-04-19 20:14:23.000000000 +0300 +++ files/lxc_at.service.2 2015-02-15 11:40:59.585572995 +0200 @@ -4,9 +4,11 @@ [Service] Restart=always -ExecStart=/usr/sbin/lxc-start -n %i +ExecStartPre=/usr/libexec/lxc/lxc-devsetup +ExecStart=/usr/sbin/lxc-start -n %i -F ExecReload=/usr/sbin/lxc-restart -n %i ExecStop=/usr/sbin/lxc-stop -n %i +Delegate=yes [Install] WantedBy=multi-user.target +*lxc-1.1.0-r1 (15 Feb 2015) + + 15 Feb 2015; Markos Chandras <hwoarang@gentoo.org> +files/lxc_at.service.2, + +lxc-1.1.0-r1.ebuild: + Since 1.1.0, guests are started in daemon mode so adapt the systemd service + file. Also add missing Delegate=yes to facilitate systemd containers. Bug + #540076 by Joachim Herb +
It looks like the new file lxc_at.service.2 is not used in the ebuild of 1.1.0-r1 so old (and wrong) file is installed to /usr/lib/systemd/system/lxc@.service: # lxc-devsetup script exeinto /usr/libexec/${PN} doexe config/init/systemd/${PN}-devsetup # Remember to compare our systemd unit file with the upstream one # config/init/systemd/lxc.service.in systemd_newunit "${FILESDIR}"/${PN}_at.service "lxc@.service" The last line should read: systemd_newunit "${FILESDIR}"/${PN}_at.service.2 "lxc@.service"
oops +*lxc-1.1.0-r2 (17 Feb 2015) + + 17 Feb 2015; Markos Chandras <hwoarang@gentoo.org> +lxc-1.1.0-r2.ebuild, + -lxc-1.1.0-r1.ebuild, -lxc-1.1.0.ebuild: + Revbump to use correct systemd file. Bug #540076. Drop old +