From 9a1f8fb43f136174fadf6b3fec764f3c706ca0acab95611c96f77a7d1ef1b602 Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Mon, 13 Feb 2023 18:18:54 +0000 Subject: [PATCH] Accepting request 1063970 from home:favogt:systemdfix - Drop allow-enable-on-boot-spice-vdagentd.service.patch. udev takes care of this already. - Don't call systemctl enable in %post, that's what presets are for. - Add 0001-Switch-to-spice-vdagent.service-by-default.patch to allow use of spice-vdagent.service OBS-URL: https://build.opensuse.org/request/show/1063970 OBS-URL: https://build.opensuse.org/package/show/Virtualization/spice-vdagent?expand=0&rev=53 --- ...-to-spice-vdagent.service-by-default.patch | 42 +++++++++++++++++++ ...nable-on-boot-spice-vdagentd.service.patch | 11 ----- spice-vdagent.changes | 9 ++++ spice-vdagent.spec | 13 ++---- 4 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 0001-Switch-to-spice-vdagent.service-by-default.patch delete mode 100644 allow-enable-on-boot-spice-vdagentd.service.patch diff --git a/0001-Switch-to-spice-vdagent.service-by-default.patch b/0001-Switch-to-spice-vdagent.service-by-default.patch new file mode 100644 index 0000000..f9eadc0 --- /dev/null +++ b/0001-Switch-to-spice-vdagent.service-by-default.patch @@ -0,0 +1,42 @@ +From aa08162f036840d3e33502dc0a836b03b9cec97c Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Wed, 8 Feb 2023 17:21:48 +0100 +Subject: [PATCH] Switch to spice-vdagent.service by default + +Add an [Install] section to the user unit and tell systemd to ignore the +.desktop file explicitly. + +Also add missing ordering dependencies. Without this, the service fails if +it is started before e.g. $DISPLAY is set. +--- + data/spice-vdagent.desktop | 1 + + data/spice-vdagent.service | 5 +++++ + 2 files changed, 6 insertions(+) + +diff --git a/data/spice-vdagent.desktop b/data/spice-vdagent.desktop +index 4424061..729a5f6 100644 +--- a/data/spice-vdagent.desktop ++++ b/data/spice-vdagent.desktop +@@ -7,3 +7,4 @@ Type=Application + Categories= + X-GNOME-Autostart-Phase=WindowManager + NoDisplay=true ++X-systemd-skip=true +diff --git a/data/spice-vdagent.service b/data/spice-vdagent.service +index a18f4ff..91734ff 100644 +--- a/data/spice-vdagent.service ++++ b/data/spice-vdagent.service +@@ -1,5 +1,10 @@ + [Unit] + Description=Spice guest session agent ++# Make sure the display is reachable ++After=graphical-session.target + + [Service] + ExecStart=/usr/bin/spice-vdagent -x ++ ++[Install] ++WantedBy=graphical-session.target +-- +2.39.1 + diff --git a/allow-enable-on-boot-spice-vdagentd.service.patch b/allow-enable-on-boot-spice-vdagentd.service.patch deleted file mode 100644 index c1808bc..0000000 --- a/allow-enable-on-boot-spice-vdagentd.service.patch +++ /dev/null @@ -1,11 +0,0 @@ -References: bsc#1204085 -Running yast2 services-manager and enabling the service -at boot time was not working. - ---- spice-vdagent-0.22.1/data/spice-vdagentd.service.orig 2022-10-10 14:43:46.164921761 -0600 -+++ spice-vdagent-0.22.1/data/spice-vdagentd.service 2022-10-10 14:49:48.988930407 -0600 -@@ -24,3 +24,4 @@ Restart=on-failure - - [Install] - Also=spice-vdagentd.socket -+WantedBy=multi-user.target diff --git a/spice-vdagent.changes b/spice-vdagent.changes index 8b6478e..eb478ec 100644 --- a/spice-vdagent.changes +++ b/spice-vdagent.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Thu Feb 9 08:31:17 UTC 2023 - Fabian Vogt + +- Drop allow-enable-on-boot-spice-vdagentd.service.patch. udev takes + care of this already. +- Don't call systemctl enable in %post, that's what presets are for. +- Add 0001-Switch-to-spice-vdagent.service-by-default.patch to allow + use of spice-vdagent.service + ------------------------------------------------------------------- Mon Oct 10 14:50:57 MDT 2022 - carnold@suse.com diff --git a/spice-vdagent.spec b/spice-vdagent.spec index 747113b..663c99f 100644 --- a/spice-vdagent.spec +++ b/spice-vdagent.spec @@ -1,7 +1,7 @@ # # spec file for package spice-vdagent # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # Copyright (c) 2014 B1 Systems GmbH, Vohburg, Germany. # # All modifications and additions to the file contributed by third parties @@ -30,8 +30,8 @@ URL: http://spice-space.org/ Source: http://spice-space.org/download/releases/%{name}-%{version}.tar.bz2 Source2: %{name}.keyring Patch0: harden_spice-vdagentd.service.patch -Patch1: allow-enable-on-boot-spice-vdagentd.service.patch - +# https://gitlab.freedesktop.org/spice/linux/vd_agent/-/merge_requests/47 +Patch1: 0001-Switch-to-spice-vdagent.service-by-default.patch BuildRequires: alsa-devel >= 1.0.22 BuildRequires: desktop-file-utils BuildRequires: libXfixes-devel @@ -65,9 +65,7 @@ Features: and the client %prep -%setup -q -%patch0 -p1 -%patch1 -p1 +%autosetup -p1 %build autoreconf @@ -97,9 +95,6 @@ rm -fr %{buildroot}%{_datadir}/gdm/autostart %post %service_add_post spice-vdagentd.service -if [ "$1" -eq 1 ]; then - systemctl -q enable spice-vdagentd.service || : -fi %service_add_post spice-vdagentd.socket %tmpfiles_create %_tmpfilesdir/spice-vdagentd.conf