Package: libvirt / 0.9.12.3-1+deb7u1

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
From: =?UTF-8?q?Laurent=20L=C3=A9onard?= <laurent@open-minds.org>
Date: Thu, 9 Dec 2010 22:36:29 +0100
Subject: Debianize libvirt-guests

Origin: vendor



---
 tools/libvirt-guests.init.sh |   41 +++++++++++++----------------------------
 tools/libvirt-guests.sysconf |    4 ++--
 2 files changed, 15 insertions(+), 30 deletions(-)

diff --git a/tools/libvirt-guests.init.sh b/tools/libvirt-guests.init.sh
index aafb4d4..386ee91 100644
--- a/tools/libvirt-guests.init.sh
+++ b/tools/libvirt-guests.init.sh
@@ -4,8 +4,8 @@
 #
 ### BEGIN INIT INFO
 # Provides: libvirt-guests
-# Required-Start: libvirtd
-# Required-Stop: libvirtd
+# Required-Start: $remote_fs libvirt-bin
+# Required-Stop: $remote_fs libvirt-bin
 # Default-Start: 2 3 4 5
 # Default-Stop: 0 1 6
 # Short-Description: suspend/resume libvirt guests on shutdown/boot
@@ -14,43 +14,29 @@
 #              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@"
-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
 
-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
 BYPASS_CACHE=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
 
@@ -499,8 +485,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 d1f2051..1173760 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
 
 # If set to non-zero, shutdown will suspend guests concurrently. Number of
 # guests on shutdown at any time will not exceed number set in this variable.