summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-08-21 13:53:16 (GMT)
committerRichard W.M. Jones <rjones@redhat.com>2012-08-21 13:53:16 (GMT)
commitb6d75ce6689d37797709ce115070dd8ba7aee629 (patch)
tree2640504097d20f8465ad926b0bb0a99a6ccc1efd
parent64e824caeb9f7b735d3a04fd0d0f3fc71d2e8b7b (diff)
downloadlibguestfs-b6d75ce6689d37797709ce115070dd8ba7aee629.zip
libguestfs-b6d75ce6689d37797709ce115070dd8ba7aee629.tar.gz
libguestfs-b6d75ce6689d37797709ce115070dd8ba7aee629.tar.xz
Use systemd scriptlets for Fedora 18+ (RHBZ#850184)
-rw-r--r--libguestfs.spec19
1 files changed, 4 insertions, 15 deletions
diff --git a/libguestfs.spec b/libguestfs.spec
index 715ac1c..15d63b5 100644
--- a/libguestfs.spec
+++ b/libguestfs.spec
@@ -492,24 +492,13 @@ safely edit files in running guests.
This daemon is *not* required by %{name}.
+# https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd
%post live-service
-if [ $1 -eq 1 ] ; then
- # Initial installation.
- /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
-
+%systemd_post guestfsd.service
%preun live-service
-if [ $1 -eq 0 ] ; then
- # Package removal, not upgrade.
- /bin/systemctl stop guestfsd.service > /dev/null 2>&1 || :
-fi
-
+%systemd_preun guestfsd.service
%postun live-service
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
- # Package upgrade, not uninstall.
- /bin/systemctl try-restart guestfsd.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart guestfsd.service
%package -n ocaml-%{name}