Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 664898 - app-emulation/lxc: systemd template file lxc@.service is broken
Summary: app-emulation/lxc: systemd template file lxc@.service is broken
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Virgil Dupras (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-30 16:17 UTC by Soren Harward
Modified: 2018-08-30 20:41 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Soren Harward 2018-08-30 16:17:34 UTC
Trying to start LXC containers through the systemd template file is broken because the template file is invalid:

# systemctl enable lxc@containername.service
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
   instance name specified.

# ln -sf /lib/systemd/system/lxc@.service /etc/systemd/system/multi-user.target.wants/lxc@containername.service
# systemctl start lxc@containername.service
Failed to start lxc@containername.service: Unit lxc@containername.service is not loaded properly: Invalid argument.
See system logs and 'systemctl status lxc@containername.service' for details.

# systemctl status lxc@containername.servicelxc@containername.service
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)

# lxc-start -n containername -F
[container starts up totally fine]

The template file worked fine with older versions of systemd, but doesn't with 238-r7 (current stable).
Comment 1 Virgil Dupras (RETIRED) gentoo-dev 2018-08-30 19:56:23 UTC
Thanks Soren for the bug report. I don't have a systemd environment around. Would you mind supplying a patch to fix this?
Comment 2 Soren Harward 2018-08-30 20:41:52 UTC
It ended up being a configuration error on my end.  My bad.