[libvirt] [PATCH] tools: Only install guests init script if --with-init=script=redhat

Required to fix https://bugzilla.redhat.com/show_bug.cgi?id=789747 --- libvirt.spec.in | 5 ++++- tools/Makefile.am | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 511949e..b3b280b 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1380,7 +1380,9 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} \ $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-docs-%{version} +%if ! %{with_systemd} sed -i -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/libvirt-guests +%endif %clean rm -fr %{buildroot} @@ -1593,8 +1595,10 @@ fi %if %{with_systemd} %{_unitdir}/libvirtd.service +%{_unitdir}/libvirt-guests.service %else %{_sysconfdir}/rc.d/init.d/libvirtd +%{_sysconfdir}/rc.d/init.d/libvirt-guests %endif %doc daemon/libvirtd.upstart %config(noreplace) %{_sysconfdir}/sysconfig/libvirtd @@ -1856,7 +1860,6 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd %{_datadir}/libvirt/cpu_map.xml -%{_sysconfdir}/rc.d/init.d/libvirt-guests %if %{with_systemd} %{_unitdir}/libvirt-guests.service %endif diff --git a/tools/Makefile.am b/tools/Makefile.am index 0d7822d..86e48e0 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -217,12 +217,12 @@ EXTRA_DIST += libvirt-guests.service.in SYSTEMD_UNIT_DIR = /lib/systemd/system if LIBVIRT_INIT_SCRIPT_SYSTEMD -install-systemd: libvirt-guests.service install-initscript install-sysconfig +install-systemd: libvirt-guests.service install-sysconfig $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) $(INSTALL_DATA) libvirt-guests.service \ $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service -uninstall-systemd: uninstall-initscript uninstall-sysconfig +uninstall-systemd: uninstall-sysconfig rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) ||: -- 1.7.11.7

On 10/21/12 04:49, Cole Robinson wrote:
Required to fix https://bugzilla.redhat.com/show_bug.cgi?id=789747 --- libvirt.spec.in | 5 ++++- tools/Makefile.am | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-)
Unfortunately, the systemd unit file is calling the init scprit as we didn't factor out the workhorse part of the script yet, so we need to install the init script along with the unit file. An option would be to put the init script somewhere else (libexec perhaps?). Peter

On 10/21/2012 07:08 AM, Peter Krempa wrote:
On 10/21/12 04:49, Cole Robinson wrote:
Required to fix https://bugzilla.redhat.com/show_bug.cgi?id=789747 --- libvirt.spec.in | 5 ++++- tools/Makefile.am | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-)
Unfortunately, the systemd unit file is calling the init scprit as we didn't factor out the workhorse part of the script yet, so we need to install the init script along with the unit file. An option would be to put the init script somewhere else (libexec perhaps?).
Thanks Peter! I should have looked more closely. I sent a v2 moving the script body to /usr/libexec/libvirt-guests.sh - Cole
participants (2)
-
Cole Robinson
-
Peter Krempa