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
This commit is contained in:
Charles Arnold 2023-02-13 18:18:54 +00:00 committed by Git OBS Bridge
parent 713789ab7a
commit 9a1f8fb43f
4 changed files with 55 additions and 20 deletions

View File

@ -0,0 +1,42 @@
From aa08162f036840d3e33502dc0a836b03b9cec97c Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fvogt@suse.de>
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

View File

@ -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

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Feb 9 08:31:17 UTC 2023 - Fabian Vogt <fvogt@suse.com>
- 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

View File

@ -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