Bug 1981338 - KDE: spice-vdagentd.socket not hearing spice-vdagent-sock
Summary: KDE: spice-vdagentd.socket not hearing spice-vdagent-sock
Keywords:
Status: CLOSED DUPLICATE of bug 1951580
Alias: None
Product: Fedora
Classification: Fedora
Component: spice-vdagent
Version: 34
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Christophe Fergeau
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-12 12:33 UTC by Todd
Modified: 2021-07-15 20:58 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-07-15 20:56:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Todd 2021-07-12 12:33:14 UTC
Fedora-KDE-Live-x86_64-34-1.2.iso

Something in KDE is stopping systemctl from creating the start up link.  Makes a mess trying to use it with qemu-kvm: no clipboard, mouse gets confined, etc..


# systemctl enable spice-vdagentd

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:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/ or .requires/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.

Comment 1 Nerijus Baliūnas 2021-07-12 14:32:36 UTC
It is activated by /usr/lib/udev/rules.d/70-spice-vdagentd.rules:

ACTION=="add", SUBSYSTEM=="virtio-ports", ENV{DEVLINKS}=="/dev/virtio-ports/com.redhat.spice.0", ENV{SYSTEMD_WANTS}="spice-vdagentd.socket"

and /usr/lib/systemd/system/spice-vdagentd.socket:

[Unit]
Description=Activation socket for spice guest agent daemon

[Socket]
ListenStream=/run/spice-vdagentd/spice-vdagent-sock

Comment 2 Todd 2021-07-12 20:17:41 UTC
Hi Nerijus,

EVERY OTHER distro I have tested, `systemctl enable spice-vdagent` work properly: Xfce, weird old gnome, etc,.  If "70-spice-vdagentd.rules" is wrong in KDE, why is it doing such and what need to be done to KDE's installer to fix it?

-T

Comment 3 Todd 2021-07-13 00:37:32 UTC
Hi Nerijus,

EVERY OTHER distro I have tested, `systemctl enable spice-vdagent` work properly: Xfce, weird old gnome, etc,.  If "70-spice-vdagentd.rules" is wrong in KDE, why is it doing such and what need to be done to KDE's installer to fix it?


If this helps:

both fresh power on boots):

KDE VM (Fedora-KDE-Live-x86_64-34-1.2.iso):
# systemctl status spice-vdagentd
○ spice-vdagentd.service - Agent daemon for Spice guests
     Loaded: loaded (/usr/lib/systemd/system/spice-vdagentd.service; indire>
     Active: inactive (dead)
TriggeredBy: ● spice-vdagentd.socket



Gnome VM (Fedora-Workstation-Live-x86_64-34-1.2.iso):
# systemctl status spice-vdagentd
● spice-vdagentd.service - Agent daemon for Spice guests
     Loaded: loaded (/usr/lib/systemd/system/spice-vdagentd.service; indirect; >
     Active: active (running) since Mon 2021-07-12 15:17:32 PDT; 2h 1min ago
TriggeredBy: ● spice-vdagentd.socket
    Process: 1190 ExecStart=/usr/sbin/spice-vdagentd $SPICE_VDAGENTD_EXTRA_ARGS>
   Main PID: 1195 (spice-vdagentd)
      Tasks: 3 (limit: 2329)
     Memory: 836.0K
        CPU: 1.125s
     CGroup: /system.slice/spice-vdagentd.service
             └─1195 /usr/sbin/spice-vdagentd

Jul 12 17:04:51 fedora spice-vdagentd[1195]: Error getting active session: No d>
Jul 12 17:04:51 fedora spice-vdagentd[1195]: Error getting active session: No d>
Jul 12 17:04:51 fedora spice-vdagentd[1195]: Error getting active session: No d>
Jul 12 17:04:53 fedora spice-vdagentd[1195]: opening vdagent virtio channel
Jul 12 17:04:53 fedora spice-vdagentd[1195]: Set max clipboard: 104857600
Jul 12 17:04:53 fedora spice-vdagentd[1195]: Set max clipboard: 104857600
Jul 12 17:18:31 fedora spice-vdagentd[1195]: closed vdagent virtio channel
Jul 12 17:18:34 fedora spice-vdagentd[1195]: opening vdagent virtio channel
Jul 12 17:18:34 fedora spice-vdagentd[1195]: Set max clipboard: 104857600
Jul 12 17:18:34 fedora spice-vdagentd[1195]: Set max clipboard: 104857600


Xfce VM (Fedora-Xfce-Live-x86_64-34-1.2.iso):
$ systemctl status spice-vdagentd
● spice-vdagentd.service - Agent daemon for Spice guests
     Loaded: loaded (/usr/lib/systemd/system/spice-vdagentd.service; enabled; v>
     Active: active (running) since Mon 2021-07-12 17:27:57 PDT; 12s ago
TriggeredBy: ● spice-vdagentd.socket
    Process: 1191 ExecStart=/usr/sbin/spice-vdagentd $SPICE_VDAGENTD_EXTRA_ARGS>
   Main PID: 1193 (spice-vdagentd)
      Tasks: 3 (limit: 2330)
     Memory: 920.0K
        CPU: 30ms
     CGroup: /system.slice/spice-vdagentd.service
             └─1193 /usr/sbin/spice-vdagentd

Comment 4 Todd 2021-07-13 06:10:24 UTC
Hi All,

Host:
   Fedora 34
   Xfce 4.14
   qemu-kvm-5.2.0-8.fc34.x86_64

Virtual Machine (VM):
   KDE installed from ISO:
         Fedora-KDE-Live-x86_64-34-1.2.iso


My assumption that "enable" was not working correctly is wrong.  It is the .socket not hearing 
    ListenStream=/run/spice-vdagentd/spice-vdagent-sock
and not triggering the .service that is at issue

The thing is, it should start automatically, but does not.


-T


$ systemctl status spice-vdagentd.service
○ spice-vdagentd.service - Agent daemon for Spice guests
     Loaded: loaded (/usr/lib/systemd/system/spice-vdagentd.service; indire>
     Active: inactive (dead)
TriggeredBy: ● spice-vdagentd.socket


$ systemctl status spice-vdagentd.socket
● spice-vdagentd.socket - Activation socket for spice guest agent daemon
     Loaded: loaded (/usr/lib/systemd/system/spice-vdagentd.socket; static)
     Active: active (listening) since Mon 2021-07-12 22:35:53 PDT; 1min 36s>
   Triggers: ● spice-vdagentd.service
     Listen: /run/spice-vdagentd/spice-vdagent-sock (Stream)
     CGroup: /system.slice/spice-vdagentd.socket

# cat /usr/lib/systemd/system/spice-vdagentd.service

[Unit]
Description=Agent daemon for Spice guests
After=dbus.target
Requires=spice-vdagentd.socket

[Service]
Type=forking
EnvironmentFile=-/etc/sysconfig/spice-vdagentd
ExecStart=/usr/sbin/spice-vdagentd $SPICE_VDAGENTD_EXTRA_ARGS
PIDFile=/run/spice-vdagentd/spice-vdagentd.pid
PrivateTmp=true
Restart=on-failure

[Install]
Also=spice-vdagentd.socket




# cat /usr/lib/systemd/system/spice-vdagentd.socket
[Unit]
Description=Activation socket for spice guest agent daemon

[Socket]
ListenStream=/run/spice-vdagentd/spice-vdagent-sock



$ systemctl status spice-vdagentd.service
○ spice-vdagentd.service - Agent daemon for Spice guests
     Loaded: loaded (/usr/lib/systemd/system/spice-vdagentd.service; indire>
     Active: inactive (dead)
TriggeredBy: ● spice-vdagentd.socket


$ systemctl status spice-vdagentd.socket
● spice-vdagentd.socket - Activation socket for spice guest agent daemon
     Loaded: loaded (/usr/lib/systemd/system/spice-vdagentd.socket; static)
     Active: active (listening) since Mon 2021-07-12 22:35:53 PDT; 1min 36s>
   Triggers: ● spice-vdagentd.service
     Listen: /run/spice-vdagentd/spice-vdagent-sock (Stream)
     CGroup: /system.slice/spice-vdagentd.socket

Comment 5 Rex Dieter 2021-07-15 20:56:54 UTC
See bug #1951580 

this has both a system-level and user-level component, the aforementioned bug is a work-in progress to provide a user level systemd service (and add appropriate dependencies to get it started for plasma environments)

*** This bug has been marked as a duplicate of bug 1951580 ***

Comment 6 Rex Dieter 2021-07-15 20:58:48 UTC
I see now this is more about the system part of the problem (which may be separate issue).  If that's the case, feel free to re-open this one.


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