Red Hat Bugzilla – Bug 1279348
libvirtd systemd socket unit cannot be enabled
Last modified: 2016-05-08 20:03:39 EDT
Description of problem:
The libvirtd.socket systemd unit does not include a [Install] section. This means it cannot be enabled to allow libvirtd to be socket activated as needed (without starting the service beforehand).
Since there is no other reference to libvirtd.socket in any other service file I assume this is a mistake and not deliberate. Or is there something else that activates it that I missed?
The unit probably should include the following (but it currently doesn't):
Version-Release number of selected component (if applicable):
Looking at the upstream sources it seems it also applies to all current versions, up to 1.2.21
Steps to Reproduce:
1. Run `systemctl enable libvirtd.socket`
Failure with the following message:
The unit files have no [Install] section. They are not meant to be enabled
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, ...).
Martin it looks like you added the .socket file to libvirt.git... thoughts on this?
I'm not that familiar with systemd, but I checked with a colleague and yeah, we should do that. I'm taking the BZ and will post a patch soon.
We actually omitted the [Install] section because if you try to use socket activation with libvirtd.service, it'll mean that VMs marked as autostart, don't get autostarted on system boot. The way to solve this is to make libvirtd create persistent units for VMs which need autostarting, so that systemd takes control of autostarting the VMs, which in turn then triggers autostarting libvirtd. Until then, I don't think we should encourage use of socket activation for libvirtd.service.
Maybe we just add a comment to the .socket file to that affect then
I completely forgot about the fact that we talked about it already. You're right. I am wondering why we keep that file in that case, though. Dan, I just remember I added the support to libvirtd based on your suggestion, so you'll be the proper one to answer and/or decide on the whole libvirtd.socket file existence.
I guess it is really a placeholder to remind us we should make it work
I guess we *could* add the [Install] section, if we also add a comment to the .socket file warning people that socket activation means that autostarted guests won't run at boot. That gives them the choice as to which feature they prefer
I don't think anyone would read that. I'd rather remove it as libvirt daemon is just not suited for socket activation and I doubt it will be.
*** Bug 1192719 has been marked as a duplicate of this bug. ***
I sent a patch removing the .socket file as Martin suggested:
Socket file removed upstream:
Author: Cole Robinson <firstname.lastname@example.org>
Date: Mon Apr 11 18:36:20 2016 -0400
Revert "daemon: use socket activation with systemd"
I'll pull it into f24
libvirt-22.214.171.124-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-f5b59b4ca5
libvirt-126.96.36.199-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-f5b59b4ca5
libvirt-188.8.131.52-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.