Package: libvirt / 5.0.0-4

debian/Debianize-libvirt-guests.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
From: =?utf-8?q?Laurent_L=C3=A9onard?= <laurent@open-minds.org>
Date: Thu, 9 Dec 2010 22:36:29 +0100
Subject: Debianize libvirt-guests

Origin: vendor
---
 tools/libvirt-guests.sh.in   | 45 +++++++++++++++++++++++++++-----------------
 tools/libvirt-guests.sysconf |  4 ++--
 2 files changed, 30 insertions(+), 19 deletions(-)

diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
index 4bc6e86..9ec4064 100644
--- a/tools/libvirt-guests.sh.in
+++ b/tools/libvirt-guests.sh.in
@@ -1,5 +1,17 @@
 #!/bin/sh
-
+#
+### BEGIN INIT INFO
+# Provides: libvirt-guests
+# Required-Start: $remote_fs libvirtd
+# Required-Stop: $remote_fs 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
+#
 # Copyright (C) 2011-2014 Red Hat, Inc.
 #
 # This library is free software; you can redistribute it and/or
@@ -16,23 +28,23 @@
 # License along with this library.  If not, see
 # <http://www.gnu.org/licenses/>.
 
-sysconfdir="@sysconfdir@"
-localstatedir="@localstatedir@"
-libvirtd="@sbindir@"/libvirtd
-
-# Source function library.
-test ! -r "$sysconfdir"/rc.d/init.d/functions ||
-    . "$sysconfdir"/rc.d/init.d/functions
+sysconfdir=/etc
+localstatedir=/var
+libvirtd=/usr/sbin/libvirtd
 
 # Source gettext library.
 # Make sure this file is recognized as having translations: _("dummy")
-. "@bindir@"/gettext.sh
+. /usr/bin/gettext.sh
+
+# Make sure calls to this script get redirected to systemctl when
+# using systemd
+. /lib/lsb/init-functions
 
-export TEXTDOMAIN="@PACKAGE@" TEXTDOMAINDIR="@localedir@"
+export TEXTDOMAIN="libvirt" TEXTDOMAINDIR="/usr/share/locale"
 
 URIS=default
-ON_BOOT=start
-ON_SHUTDOWN=suspend
+ON_BOOT=ignore
+ON_SHUTDOWN=shutdown
 SHUTDOWN_TIMEOUT=300
 PARALLEL_SHUTDOWN=0
 START_DELAY=0
@@ -41,11 +53,11 @@ CONNECT_RETRIES=10
 RETRIES_SLEEP=1
 SYNC_TIME=0
 
-test -f "$sysconfdir"/sysconfig/libvirt-guests &&
-    . "$sysconfdir"/sysconfig/libvirt-guests
+test -f "$sysconfdir"/default/libvirt-guests &&
+    . "$sysconfdir"/default/libvirt-guests
 
 LISTFILE="$localstatedir"/lib/libvirt/libvirt-guests
-VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/subsys/libvirt-guests
+VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/libvirt-guests
 
 RETVAL=0
 
@@ -552,8 +564,7 @@ gueststatus() {
 
 # rh_status
 # Display current status: whether saved state exists, and whether start
-# has been executed.  We cannot use status() from the functions library,
-# since there is no external daemon process matching this init script.
+# has been executed.
 rh_status() {
     if [ -f "$LISTFILE" ]; then
         gettext "stopped, with saved guests"; echo
diff --git a/tools/libvirt-guests.sysconf b/tools/libvirt-guests.sysconf
index 669b046..1c4b450 100644
--- a/tools/libvirt-guests.sysconf
+++ b/tools/libvirt-guests.sysconf
@@ -8,7 +8,7 @@
 # - ignore  libvirt-guests init script won't start any guest on boot, however,
 #           guests marked as autostart will still be automatically started by
 #           libvirtd
-#ON_BOOT=start
+#ON_BOOT=ignore
 
 # Number of seconds to wait between each guest start. Set to 0 to allow
 # parallel startup.
@@ -22,7 +22,7 @@
 #             which just needs a long time to shutdown. When setting
 #             ON_SHUTDOWN=shutdown, you must also set SHUTDOWN_TIMEOUT to a
 #             value suitable for your guests.
-#ON_SHUTDOWN=suspend
+#ON_SHUTDOWN=shutdown
 
 # Number of guests will be shutdown concurrently, taking effect when
 # "ON_SHUTDOWN" is set to "shutdown". If Set to 0, guests will be shutdown one