mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
tools: Only install guests init script if --with-init=script=redhat
Most of this deals with moving the libvirt-guests.sh script which does all the work to /usr/libexec, so it can be shared by both systemd and traditional init. Previously systemd depended on the script being in /etc/init.d Required to fix https://bugzilla.redhat.com/show_bug.cgi?id=789747 (cherry picked from commit d13155c20c0df9595e33c120a68b3544192d6740)
This commit is contained in:
parent
536c0e3e4f
commit
2b47328d44
1
.gitignore
vendored
1
.gitignore
vendored
@ -176,6 +176,7 @@
|
|||||||
/tools/*.[18]
|
/tools/*.[18]
|
||||||
/tools/libvirt-guests.init
|
/tools/libvirt-guests.init
|
||||||
/tools/libvirt-guests.service
|
/tools/libvirt-guests.service
|
||||||
|
/tools/libvirt-guests.sh
|
||||||
/tools/virsh
|
/tools/virsh
|
||||||
/tools/virsh-*-edit.c
|
/tools/virsh-*-edit.c
|
||||||
/tools/virt-*-validate
|
/tools/virt-*-validate
|
||||||
|
@ -1382,8 +1382,6 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
|
|||||||
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} \
|
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} \
|
||||||
$RPM_BUILD_ROOT%{_datadir}/doc/libvirt-docs-%{version}
|
$RPM_BUILD_ROOT%{_datadir}/doc/libvirt-docs-%{version}
|
||||||
|
|
||||||
sed -i -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/libvirt-guests
|
|
||||||
|
|
||||||
%if %{with_dtrace}
|
%if %{with_dtrace}
|
||||||
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
|
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
|
||||||
mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes.stp \
|
mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes.stp \
|
||||||
@ -1622,10 +1620,13 @@ fi
|
|||||||
|
|
||||||
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
|
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
|
||||||
|
|
||||||
|
%attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh
|
||||||
%if %{with_systemd}
|
%if %{with_systemd}
|
||||||
%{_unitdir}/libvirtd.service
|
%{_unitdir}/libvirtd.service
|
||||||
|
%{_unitdir}/libvirt-guests.service
|
||||||
%else
|
%else
|
||||||
%{_sysconfdir}/rc.d/init.d/libvirtd
|
%{_sysconfdir}/rc.d/init.d/libvirtd
|
||||||
|
%{_sysconfdir}/rc.d/init.d/libvirt-guests
|
||||||
%endif
|
%endif
|
||||||
%doc daemon/libvirtd.upstart
|
%doc daemon/libvirtd.upstart
|
||||||
%config(noreplace) %{_sysconfdir}/sysconfig/libvirtd
|
%config(noreplace) %{_sysconfdir}/sysconfig/libvirtd
|
||||||
@ -1886,7 +1887,6 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
|
|||||||
|
|
||||||
%{_datadir}/libvirt/cpu_map.xml
|
%{_datadir}/libvirt/cpu_map.xml
|
||||||
|
|
||||||
%{_sysconfdir}/rc.d/init.d/libvirt-guests
|
|
||||||
%if %{with_systemd}
|
%if %{with_systemd}
|
||||||
%{_unitdir}/libvirt-guests.service
|
%{_unitdir}/libvirt-guests.service
|
||||||
%endif
|
%endif
|
||||||
|
@ -185,7 +185,7 @@ src/xenapi/xenapi_utils.c
|
|||||||
src/xenxs/xen_sxpr.c
|
src/xenxs/xen_sxpr.c
|
||||||
src/xenxs/xen_xm.c
|
src/xenxs/xen_xm.c
|
||||||
tools/console.c
|
tools/console.c
|
||||||
tools/libvirt-guests.init.sh
|
tools/libvirt-guests.sh.in
|
||||||
tools/virsh.c
|
tools/virsh.c
|
||||||
tools/virsh-domain-monitor.c
|
tools/virsh-domain-monitor.c
|
||||||
tools/virsh-domain.c
|
tools/virsh-domain.c
|
||||||
|
@ -41,6 +41,7 @@ DISTCLEANFILES =
|
|||||||
|
|
||||||
bin_SCRIPTS = virt-xml-validate virt-pki-validate
|
bin_SCRIPTS = virt-xml-validate virt-pki-validate
|
||||||
bin_PROGRAMS = virsh virt-host-validate
|
bin_PROGRAMS = virsh virt-host-validate
|
||||||
|
libexec_SCRIPTS = libvirt-guests.sh
|
||||||
|
|
||||||
if HAVE_SANLOCK
|
if HAVE_SANLOCK
|
||||||
sbin_SCRIPTS = virt-sanlock-cleanup
|
sbin_SCRIPTS = virt-sanlock-cleanup
|
||||||
@ -187,7 +188,7 @@ uninstall-sysconfig:
|
|||||||
rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
|
rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
|
||||||
rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||:
|
rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||:
|
||||||
|
|
||||||
EXTRA_DIST += libvirt-guests.init.sh
|
EXTRA_DIST += libvirt-guests.sh.in libvirt-guests.init.in
|
||||||
|
|
||||||
install-initscript: libvirt-guests.init
|
install-initscript: libvirt-guests.init
|
||||||
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
|
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
|
||||||
@ -208,7 +209,7 @@ install-init:
|
|||||||
uninstall-init:
|
uninstall-init:
|
||||||
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
|
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
|
||||||
|
|
||||||
libvirt-guests.init: libvirt-guests.init.sh $(top_builddir)/config.status
|
libvirt-guests.sh: libvirt-guests.sh.in $(top_builddir)/config.status
|
||||||
$(AM_V_GEN)sed \
|
$(AM_V_GEN)sed \
|
||||||
-e 's!\@PACKAGE\@!$(PACKAGE)!g' \
|
-e 's!\@PACKAGE\@!$(PACKAGE)!g' \
|
||||||
-e 's!\@bindir\@!$(bindir)!g' \
|
-e 's!\@bindir\@!$(bindir)!g' \
|
||||||
@ -219,20 +220,26 @@ libvirt-guests.init: libvirt-guests.init.sh $(top_builddir)/config.status
|
|||||||
< $< > $@-t && \
|
< $< > $@-t && \
|
||||||
chmod a+x $@-t && \
|
chmod a+x $@-t && \
|
||||||
mv $@-t $@
|
mv $@-t $@
|
||||||
|
BUILT_SOURCES += libvirt-guests.sh
|
||||||
|
|
||||||
|
libvirt-guests.init: libvirt-guests.init.in libvirt-guests.sh
|
||||||
|
$(AM_V_GEN)sed \
|
||||||
|
-e 's!\@libexecdir\@!$(libexecdir)!g' \
|
||||||
|
< $< > $@-t && \
|
||||||
|
chmod a+x $@-t && \
|
||||||
|
mv $@-t $@
|
||||||
|
|
||||||
|
|
||||||
EXTRA_DIST += libvirt-guests.service.in
|
EXTRA_DIST += libvirt-guests.service.in
|
||||||
|
|
||||||
SYSTEMD_UNIT_DIR = /lib/systemd/system
|
SYSTEMD_UNIT_DIR = /lib/systemd/system
|
||||||
|
|
||||||
if LIBVIRT_INIT_SCRIPT_SYSTEMD
|
if LIBVIRT_INIT_SCRIPT_SYSTEMD
|
||||||
install-systemd: libvirt-guests.service install-initscript install-sysconfig
|
install-systemd: libvirt-guests.service install-sysconfig libvirt-guests.sh
|
||||||
$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
|
$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
|
||||||
$(INSTALL_DATA) libvirt-guests.service \
|
$(INSTALL_DATA) libvirt-guests.service \
|
||||||
$(DESTDIR)$(SYSTEMD_UNIT_DIR)/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
|
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
|
||||||
rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) ||:
|
rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) ||:
|
||||||
|
|
||||||
@ -251,6 +258,7 @@ libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status
|
|||||||
-e 's!\@localstatedir\@!$(localstatedir)!g' \
|
-e 's!\@localstatedir\@!$(localstatedir)!g' \
|
||||||
-e 's!\@sbindir\@!$(sbindir)!g' \
|
-e 's!\@sbindir\@!$(sbindir)!g' \
|
||||||
-e 's!\@sysconfdir\@!$(sysconfdir)!g' \
|
-e 's!\@sysconfdir\@!$(sysconfdir)!g' \
|
||||||
|
-e 's!\@libexecdir\@!$(libexecdir)!g' \
|
||||||
< $< > $@-t && \
|
< $< > $@-t && \
|
||||||
chmod a+x $@-t && \
|
chmod a+x $@-t && \
|
||||||
mv $@-t $@
|
mv $@-t $@
|
||||||
|
27
tools/libvirt-guests.init.in
Normal file
27
tools/libvirt-guests.init.in
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# the following is the LSB init header
|
||||||
|
#
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: libvirt-guests
|
||||||
|
# Required-Start: libvirtd
|
||||||
|
# Required-Stop: libvirtd
|
||||||
|
# Default-Start: 2 3 4 5
|
||||||
|
# Default-Stop: 0 1 6
|
||||||
|
# Short-Description: suspend/resume libvirt guests on shutdown/boot
|
||||||
|
# Description: This is a script for suspending active libvirt guests
|
||||||
|
# on shutdown and resuming them on next boot
|
||||||
|
# See http://libvirt.org
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
# the following is chkconfig init header
|
||||||
|
#
|
||||||
|
# libvirt-guests: suspend/resume libvirt guests on shutdown/boot
|
||||||
|
#
|
||||||
|
# chkconfig: 345 99 01
|
||||||
|
# description: This is a script for suspending active libvirt guests \
|
||||||
|
# on shutdown and resuming them on next boot \
|
||||||
|
# See http://libvirt.org
|
||||||
|
#
|
||||||
|
|
||||||
|
exec @libexecdir@/libvirt-guests.sh "$@"
|
@ -6,8 +6,8 @@ After=syslog.target network.target
|
|||||||
EnvironmentFile=-/etc/sysconfig/libvirt-guests
|
EnvironmentFile=-/etc/sysconfig/libvirt-guests
|
||||||
# Hack just call traditional service until we factor
|
# Hack just call traditional service until we factor
|
||||||
# out the code
|
# out the code
|
||||||
ExecStart=/etc/init.d/libvirt-guests start
|
ExecStart=@libexecdir@/libvirt-guests.sh start
|
||||||
ExecStop=/etc/init.d/libvirt-guests stop
|
ExecStop=@libexecdir@/libvirt-guests.sh stop
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
StandardOutput=journal+console
|
StandardOutput=journal+console
|
||||||
|
@ -1,29 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# the following is the LSB init header
|
|
||||||
#
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: libvirt-guests
|
|
||||||
# Required-Start: libvirtd
|
|
||||||
# Required-Stop: libvirtd
|
|
||||||
# Default-Start: 2 3 4 5
|
|
||||||
# Default-Stop: 0 1 6
|
|
||||||
# Short-Description: suspend/resume libvirt guests on shutdown/boot
|
|
||||||
# Description: This is a script for suspending active libvirt guests
|
|
||||||
# on shutdown and resuming them on next boot
|
|
||||||
# See http://libvirt.org
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
# the following is chkconfig init header
|
|
||||||
#
|
|
||||||
# libvirt-guests: suspend/resume libvirt guests on shutdown/boot
|
|
||||||
#
|
|
||||||
# chkconfig: 345 99 01
|
|
||||||
# description: This is a script for suspending active libvirt guests \
|
|
||||||
# on shutdown and resuming them on next boot \
|
|
||||||
# See http://libvirt.org
|
|
||||||
#
|
|
||||||
|
|
||||||
sysconfdir="@sysconfdir@"
|
sysconfdir="@sysconfdir@"
|
||||||
localstatedir="@localstatedir@"
|
localstatedir="@localstatedir@"
|
||||||
libvirtd="@sbindir@"/libvirtd
|
libvirtd="@sbindir@"/libvirtd
|
Loading…
x
Reference in New Issue
Block a user