From: "Daniel P. Berrange" <berrange(a)redhat.com>
The installation rules for the libvirt-guests.service were
totally broken
- Installing in the wrong location
- The location was not overridable
- The install-systemd rule was not invoked anywhere
- The install-systemd rule was not invoking install-initscript
which it depends on
- The installed service file lacked a .service extension
* tools/Makefile.am: Fix install of libvirt-guests.service
---
tools/Makefile.am | 27 ++++++++++++++++-----------
1 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/tools/Makefile.am b/tools/Makefile.am
index c735398..25f0ffe 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -148,9 +148,9 @@ endif
virsh.1: virsh.pod
$(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@
-install-data-local: install-init
+install-data-local: install-init install-systemd
-uninstall-local: uninstall-init
+uninstall-local: uninstall-init uninstall-systemd
install-sysconfig:
mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
@@ -162,17 +162,20 @@ uninstall-sysconfig:
EXTRA_DIST += libvirt-guests.init.sh
-if LIBVIRT_INIT_SCRIPT_RED_HAT
-install-init: libvirt-guests.init install-sysconfig
+install-initscript: libvirt-guests.init
mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
$(INSTALL_SCRIPT) libvirt-guests.init \
$(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests
-uninstall-init: install-sysconfig
+uninstall-initscript:
rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests
-BUILT_SOURCES += libvirt-guests.init
+
+if LIBVIRT_INIT_SCRIPT_RED_HAT
+BUILT_SOURCES += libvirt-guests.init
+install-init: install-sysconfig install-initscript
+uninstall-init: uninstall-sysconfig uninstall-initscript
else
install-init:
uninstall-init:
@@ -194,14 +197,16 @@ libvirt-guests.init: libvirt-guests.init.sh
$(top_builddir)/config.status
EXTRA_DIST += libvirt-guests.service.in
+SYSTEMD_UNIT_DIR = /lib/systemd/system
+
if LIBVIRT_INIT_SCRIPT_SYSTEMD
-install-systemd: libvirt-guests.service install-sysconfig
- mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/systemd.d
+install-systemd: libvirt-guests.service install-initscript install-sysconfig
+ mkdir -p $(DESTDIR)$(SYSTEMD_UNIT_DIR)
$(INSTALL_SCRIPT) libvirt-guests.service \
- $(DESTDIR)$(sysconfdir)/rc.d/systemd.d/libvirt-guests
+ $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
-uninstall-systemd: install-sysconfig
- rm -f $(DESTDIR)$(sysconfdir)/rc.d/systemd.d/libvirt-guests
+uninstall-systemd: uninstall-initscript uninstall-sysconfig
+ rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
BUILT_SOURCES += libvirt-guests.service
--
1.7.7.3