Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 716452 - app-emulation/libvirt-6.1.0: can't listen on tcp when using systemd
Summary: app-emulation/libvirt-6.1.0: can't listen on tcp when using systemd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Matthias Maier
URL: https://www.redhat.com/archives/libvi...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-06 13:45 UTC by Petrus
Modified: 2020-04-06 18:29 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 Petrus 2020-04-06 13:45:01 UTC
➜ grep -Ev "#|^$" /etc/libvirt/libvirtd.conf
listen_tls = 0
listen_tcp = 1
tcp_port = "16509"
listen_addr = "192.168.2.71"
auth_tcp = "none"

➜ grep -Ev "#|^$" /etc/systemd/system/libvirtd.service.d/00gentoo.conf
[Service]
ExecStart=
ExecStart=/usr/sbin/libvirtd --listen

➜ grep -Ev "#|^$" /etc/conf.d/libvirtd
rc_need="net"
LIBVIRTD_OPTS="--listen"

Alias tip: _ systemctl status libvirtd.service
● libvirtd.service - Virtualization daemon
     Loaded: loaded (/lib/systemd/system/libvirtd.service; disabled; vendor preset: disabled)
    Drop-In: /etc/systemd/system/libvirtd.service.d
             └─00gentoo.conf
     Active: failed (Result: exit-code) since Mon 2020-04-06 21:41:11 CST; 3s ago
TriggeredBy: ● libvirtd-ro.socket
             ● libvirtd.socket
             ● libvirtd-admin.socket
       Docs: man:libvirtd(8)
             https://libvirt.org
    Process: 720532 ExecStart=/usr/sbin/libvirtd --listen (code=exited, status=6)
   Main PID: 720532 (code=exited, status=6)

Apr 06 21:41:11 deskmini systemd[1]: libvirtd.service: Scheduled restart job, restart counter is at 5.
Apr 06 21:41:11 deskmini systemd[1]: Stopped Virtualization daemon.
Apr 06 21:41:11 deskmini systemd[1]: libvirtd.service: Start request repeated too quickly.
Apr 06 21:41:11 deskmini systemd[1]: libvirtd.service: Failed with result 'exit-code'.
Apr 06 21:41:11 deskmini systemd[1]: Failed to start Virtualization daemon.


Seems --listen parameter is outdated, and libvirtd.service doesn't read /etc/conf.d/libvirtd.
Comment 1 Larry the Git Cow gentoo-dev 2020-04-06 17:46:43 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9b6391550bfcf0b1aaab11cbfd3a1b4e6e847e5

commit c9b6391550bfcf0b1aaab11cbfd3a1b4e6e847e5
Author:     Matthias Maier <tamiko@gentoo.org>
AuthorDate: 2020-04-06 17:41:08 +0000
Commit:     Matthias Maier <tamiko@gentoo.org>
CommitDate: 2020-04-06 17:46:30 +0000

    app-emulation/libvirt: remove --listen parameter for systemd unit files
    
    Upstream-Changes: https://www.redhat.com/archives/libvir-list/2019-August/msg01070.html
    Closes: https://bugs.gentoo.org/716452
    Package-Manager: Portage-2.3.96, Repoman-2.3.22
    RepoMan-Options: --force
    Signed-off-by: Matthias Maier <tamiko@gentoo.org>

 .../libvirt/files/{README.gentoo-r2 => README.gentoo-r3}       |  4 ++--
 app-emulation/libvirt/files/libvirtd.service.conf              | 10 ----------
 .../{libvirt-6.0.0-r2.ebuild => libvirt-6.0.0-r3.ebuild}       |  5 +----
 .../libvirt/{libvirt-6.2.0.ebuild => libvirt-6.1.0-r1.ebuild}  |  5 +----
 .../libvirt/{libvirt-6.1.0.ebuild => libvirt-6.2.0-r1.ebuild}  |  5 +----
 app-emulation/libvirt/libvirt-9999.ebuild                      |  5 +----
 6 files changed, 6 insertions(+), 28 deletions(-)
Comment 2 Petrus 2020-04-06 17:50:58 UTC
Wait a minute, then how should I set libvirtd listen tcp/tls on systemd?
Comment 3 Matthias Maier gentoo-dev 2020-04-06 17:54:39 UTC
I have removed the obsolete "--listen" parameter from the documentation and removed the "00gentoo.conf" drop-in.

You will have to use libvirtd-tcp.socket with systemd.
Comment 4 Petrus 2020-04-06 17:56:22 UTC
Ok, thanks.
Comment 5 Matthias Maier gentoo-dev 2020-04-06 18:29:56 UTC
(In reply to Petrus from comment #4)
> Ok, thanks.

It should be enough to simple enable the libvirtd-tcp.socket
(and manually start it before the libvirtd.service)

If you want to make this more strict you can add an override adding

[Unit]
Requires=libvirtd-tcp.socket

to the libvirtd.service file.