Bug 1279348 - libvirtd systemd socket unit cannot be enabled
libvirtd systemd socket unit cannot be enabled
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
All Linux
unspecified Severity low
: ---
: ---
Assigned To: Libvirt Maintainers
Fedora Extras Quality Assurance
: 1192719 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2015-11-09 04:06 EST by Daniel Miranda
Modified: 2016-05-08 20:03 EDT (History)
14 users (show)

See Also:
Fixed In Version: libvirt-
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-05-08 20:03:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Daniel Miranda 2015-11-09 04:06:43 EST
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

How reproducible:


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:

Comment 1 Cole Robinson 2015-11-10 16:31:44 EST
Martin it looks like you added the .socket file to libvirt.git... thoughts on this?
Comment 2 Martin Kletzander 2015-11-11 10:08:38 EST
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 Berrange 2015-11-11 10:21:27 EST
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 10:23:55 EST
Maybe we just add a comment to the .socket file to that affect then
Comment 5 Martin Kletzander 2015-11-11 10:34:08 EST
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 Berrange 2015-11-11 10:38:23 EST
I guess it is really a placeholder to remind us we should make it work
Comment 7 Daniel Berrange 2015-11-13 06:34:33 EST
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 07:24:27 EST
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 18:20:58 EDT
*** Bug 1192719 has been marked as a duplicate of this bug. ***
Comment 10 Cole Robinson 2016-04-11 19:09:32 EDT
I sent a patch removing the .socket file as Martin suggested:

Comment 11 Cole Robinson 2016-04-20 09:01:39 EDT
Socket file removed upstream:

commit 3b9100a4d255fdb5f731fcfa49326746d371894a
Author: Cole Robinson <crobinso@redhat.com>
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 08:52:26 EDT
libvirt- 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 07:27:31 EDT
libvirt- 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-08 20:03:09 EDT
libvirt- 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.