mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
libvirtd: systemd: add special target for system shutdown
It is already discussed in "[RFC] daemon: remove hardcode dep on libvirt-guests" [1]. Mgmt can use means to save/restore domains on system shutdown/boot other than libvirt-guests.service. Thus we need to specify appropriate ordering dependency between libvirtd, domains and save/restore service. This patch takes approach suggested in RFC and introduces a systemd target, so that ordering can be built next way: libvirtd -> domain -> virt-guest-shutdown.target -> save-restore.service. This way domains are decoupled from specific shutdown service via intermediate target. [1] https://www.redhat.com/archives/libvir-list/2016-September/msg01353.html
This commit is contained in:
committed by
Maxim Nestratov
parent
29dc9a52d7
commit
01079727fe
@@ -67,6 +67,7 @@ EXTRA_DIST = \
|
||||
libvirt.rules \
|
||||
libvirtd.sasl \
|
||||
libvirtd.service.in \
|
||||
virt-guest-shutdown.target \
|
||||
libvirtd.sysconf \
|
||||
libvirtd.sysctl \
|
||||
libvirtd.aug \
|
||||
@@ -456,8 +457,11 @@ install-init-systemd: install-sysconfig libvirtd.service
|
||||
$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
|
||||
$(INSTALL_DATA) libvirtd.service \
|
||||
$(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
|
||||
$(INSTALL_DATA) virt-guest-shutdown.target \
|
||||
$(DESTDIR)$(SYSTEMD_UNIT_DIR)/virt-guest-shutdown.target
|
||||
|
||||
uninstall-init-systemd: uninstall-sysconfig
|
||||
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virt-guest-shutdown.target
|
||||
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
|
||||
rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
|
||||
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
[Unit]
|
||||
Description=Libvirt guests shutdown
|
||||
Documentation=http://libvirt.org
|
||||
Reference in New Issue
Block a user