Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 507750

Summary: app-emulation/lxc - add systemd support
Product: Gentoo Linux Reporter: Joachim Herb <joachim.herb>
Component: Current packagesAssignee: Diego Elio Pettenò (RETIRED) <flameeyes>
Status: RESOLVED FIXED    
Severity: normal CC: dev-zero, systemd, virtualization
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 448882    

Description Joachim Herb 2014-04-15 18:04:25 UTC
The package app-emulation/lxc does not include a systemd start script. Here is a starting point for implementing one (named lxc@.service):
[Unit]
Description=Linux Container %I
After=network.target

[Service]
Type=simple
Restart=always
ExecStart=/usr/sbin/lxc-start -n %i
ExecReload=/usr/sbin/lxc-restart -n %i
ExecStop=/usr/sbin/lxc-stop -n %i

[Install]
WantedBy=multi-user.target

It can be enabled with 
systemctl enable lxc@guestname.service
where guestname is name of the LXC container.

See also: http://wiki.gentoo.org/wiki/LXC#Use_from_gentoo_systemd
 

Reproducible: Always
Comment 1 Pacho Ramos gentoo-dev 2014-04-19 17:14:34 UTC
+*lxc-0.8.0-r2 (19 Apr 2014)
+
+  19 Apr 2014; Pacho Ramos <pacho@gentoo.org> +files/lxc_at.service,
+  +lxc-0.8.0-r2.ebuild:
+  Add unit file (#507750 by Joachim Herb)
+