Bug 1279348 - libvirtd systemd socket unit cannot be enabled
Summary: libvirtd systemd socket unit cannot be enabled
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 24
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1192719 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-09 09:06 UTC by Daniel Miranda
Modified: 2016-05-09 00:03 UTC (History)
14 users (show)

Fixed In Version: libvirt-1.3.3.1-1.fc24
Clone Of:
Environment:
Last Closed: 2016-05-09 00:03:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Daniel Miranda 2015-11-09 09:06:43 UTC
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):

 [Install]
 WantedBy=sockets.target


Version-Release number of selected component (if applicable):

libvirt 1.2.13.1

Looking at the upstream sources it seems it also applies to all current versions, up to 1.2.21


How reproducible:

Always


Steps to Reproduce:

1. Run `systemctl enable libvirtd.socket`


Actual results:

Failure with the following message:

 The unit files have no [Install] section. 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, ...).


Expected results:

Success.

Comment 1 Cole Robinson 2015-11-10 21:31:44 UTC
Martin it looks like you added the .socket file to libvirt.git... thoughts on this?

Comment 2 Martin Kletzander 2015-11-11 15:08:38 UTC
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.

Comment 3 Daniel Berrangé 2015-11-11 15:21:27 UTC
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.

Comment 4 Cole Robinson 2015-11-11 15:23:55 UTC
Maybe we just add a comment to the .socket file to that affect then

Comment 5 Martin Kletzander 2015-11-11 15:34:08 UTC
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.

Comment 6 Daniel Berrangé 2015-11-11 15:38:23 UTC
I guess it is really a placeholder to remind us we should make it work

Comment 7 Daniel Berrangé 2015-11-13 11:34:33 UTC
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

Comment 8 Martin Kletzander 2015-11-13 12:24:27 UTC
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.

Comment 9 Cole Robinson 2016-04-11 22:20:58 UTC
*** Bug 1192719 has been marked as a duplicate of this bug. ***

Comment 10 Cole Robinson 2016-04-11 23:09:32 UTC
I sent a patch removing the .socket file as Martin suggested:

http://www.redhat.com/archives/libvir-list/2016-April/msg00537.html

Comment 11 Cole Robinson 2016-04-20 13:01:39 UTC
Socket file removed upstream:

commit 3b9100a4d255fdb5f731fcfa49326746d371894a
Author: Cole Robinson <crobinso>
Date:   Mon Apr 11 18:36:20 2016 -0400

    Revert "daemon: use socket activation with systemd"

I'll pull it into f24

Comment 12 Fedora Update System 2016-05-05 12:52:26 UTC
libvirt-1.3.3.1-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-f5b59b4ca5

Comment 13 Fedora Update System 2016-05-06 11:27:31 UTC
libvirt-1.3.3.1-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

Comment 14 Fedora Update System 2016-05-09 00:03:09 UTC
libvirt-1.3.3.1-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.