From 5895d4fb84acb40582b0675d4d82d203dd99c725 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 30 Oct 2023 10:10:41 +0000 Subject: [PATCH] Fix systemd services https://docs.fedoraproject.org/en-US/packaging-guidelines/Systemd/ https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_systemd (cherry picked from commit 36a58432604693c945dab485bd16b8faa63bf19f) --- libvirt-dbus.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libvirt-dbus.spec b/libvirt-dbus.spec index 2b37556..14b963a 100644 --- a/libvirt-dbus.spec +++ b/libvirt-dbus.spec @@ -24,6 +24,7 @@ BuildRequires: python36-docutils %else BuildRequires: python3-docutils %endif +BuildRequires: systemd-rpm-macros Requires: dbus Requires: glib2 >= %{glib2_version} @@ -53,6 +54,15 @@ getent passwd %{system_user} >/dev/null || \ -c "Libvirt D-Bus bridge" %{system_user} exit 0 +%post +%systemd_post %{name}.service + +%preun +%systemd_preun %{name}.service + +%postun +%systemd_postun_with_reload %{name}.service + %files %doc AUTHORS.rst NEWS.rst %license COPYING @@ -63,6 +73,8 @@ exit 0 %{_datadir}/dbus-1/interfaces/org.libvirt.*.xml %{_datadir}/polkit-1/rules.d/libvirt-dbus.rules %{_mandir}/man8/libvirt-dbus.8* +%{_unitdir}/%{name}.service +%{_userunitdir}/%{name}.service %changelog * Mon Oct 30 2023 Ladar Levison