[Pkg-libvirt-commits] [SCM] Libvirt Debian packaging branch, experimental, updated. debian/0.8.6-1-8-g6408c57

Laurent Léonard laurent at open-minds.org
Tue Dec 14 10:49:01 UTC 2010


The following commit has been merged in the experimental branch:
commit 7d7aed44c56d113713547e5dd9bdbe4ab6684c00
Author: Laurent Léonard <laurent at open-minds.org>
Date:   Tue Dec 14 11:24:42 2010 +0100

    New patch 0010-Debianize-libvirt-guests.patch

diff --git a/debian/patches/0010-Debianize-libvirt-guests.patch b/debian/patches/0010-Debianize-libvirt-guests.patch
new file mode 100644
index 0000000..fdc39d2
--- /dev/null
+++ b/debian/patches/0010-Debianize-libvirt-guests.patch
@@ -0,0 +1,238 @@
+From: =?UTF-8?q?Laurent=20L=C3=A9onard?= <laurent at open-minds.org>
+Date: Thu, 9 Dec 2010 22:36:29 +0100
+Subject: [PATCH] Debianize libvirt-guests
+
+Origin: vendor
+---
+ tools/libvirt-guests.init.in |   78 +++++++++++++++++------------------------
+ tools/libvirt-guests.sysconf |    6 ++--
+ 2 files changed, 35 insertions(+), 49 deletions(-)
+
+diff --git a/tools/libvirt-guests.init.in b/tools/libvirt-guests.init.in
+index 5dab36b..0fe82fb 100644
+--- a/tools/libvirt-guests.init.in
++++ b/tools/libvirt-guests.init.in
+@@ -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,32 +14,19 @@
+ #              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.
+-. "$sysconfdir"/rc.d/init.d/functions
++sysconfdir=/etc
++localstatedir=/var
++libvirtd=/usr/sbin/libvirtd
+ 
+ URIS=default
+-ON_BOOT=start
+-ON_SHUTDOWN=suspend
+-SHUTDOWN_TIMEOUT=0
++ON_BOOT=ignore
++ON_SHUTDOWN=shutdown
++SHUTDOWN_TIMEOUT=30
+ 
+-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
+ 
+@@ -128,7 +115,7 @@ start() {
+     [ -f "$LISTFILE" ] || { started; return 0; }
+ 
+     if [ "x$ON_BOOT" != xstart ]; then
+-        echo $"libvirt-guests is configured not to start any guests on boot"
++        echo "libvirt-guests is configured not to start any guests on boot"
+         rm -f "$LISTFILE"
+         started
+         return 0
+@@ -143,20 +130,20 @@ start() {
+             fi
+         done
+         if ! $configured; then
+-            echo $"Ignoring guests on $uri URI"
++            echo "Ignoring guests on $uri URI"
+             continue
+         fi
+ 
+-        echo $"Resuming guests on $uri URI..."
++        echo "Resuming guests on $uri URI..."
+         for guest in $list; do
+             name=$(guest_name $uri $guest)
+-            echo -n $"Resuming guest $name: "
++            echo -n "Resuming guest $name: "
+             if guest_is_on $uri $guest; then
+                 if $guest_running; then
+-                    echo $"already active"
++                    echo "already active"
+                 else
+                     retval run_virsh $uri start "$name" >/dev/null && \
+-                    echo $"done"
++                    echo "done"
+                 fi
+             fi
+         done
+@@ -172,7 +159,7 @@ suspend_guest()
+     guest=$2
+ 
+     name=$(guest_name $uri $guest)
+-    label=$"Suspending $name: "
++    label="Suspending $name: "
+     echo -n "$label"
+     run_virsh $uri managedsave $guest >/dev/null &
+     virsh_pid=$!
+@@ -187,7 +174,7 @@ suspend_guest()
+             printf '\r%s%-12s ' "$label" "..."
+         fi
+     done
+-    retval wait $virsh_pid && printf '\r%s%-12s\n' "$label" $"done"
++    retval wait $virsh_pid && printf '\r%s%-12s\n' "$label" "done"
+ }
+ 
+ shutdown_guest()
+@@ -196,7 +183,7 @@ shutdown_guest()
+     guest=$2
+ 
+     name=$(guest_name $uri $guest)
+-    label=$"Shutting down $name: "
++    label="Shutting down $name: "
+     echo -n "$label"
+     retval run_virsh $uri shutdown $guest >/dev/null || return
+     timeout=$SHUTDOWN_TIMEOUT
+@@ -210,9 +197,9 @@ shutdown_guest()
+ 
+     if guest_is_on $uri $guest; then
+         if $guest_running; then
+-            printf '\r%s%-12s\n' "$label" $"failed to shutdown in time"
++            printf '\r%s%-12s\n' "$label" "failed to shutdown in time"
+         else
+-            printf '\r%s%-12s\n' "$label" $"done"
++            printf '\r%s%-12s\n' "$label" "done"
+         fi
+     fi
+ }
+@@ -225,7 +212,7 @@ stop() {
+     if [ "x$ON_SHUTDOWN" = xshutdown ]; then
+         suspending=false
+         if [ $SHUTDOWN_TIMEOUT -le 0 ]; then
+-            echo $"Shutdown action requested but SHUTDOWN_TIMEOUT was not set"
++            echo "Shutdown action requested but SHUTDOWN_TIMEOUT was not set"
+             RETVAL=6
+             return
+         fi
+@@ -233,10 +220,10 @@ stop() {
+ 
+     : >"$LISTFILE"
+     for uri in $URIS; do
+-        echo -n $"Running guests on $uri URI: "
++        echo -n "Running guests on $uri URI: "
+ 
+         if [ "x$uri" = xdefault ] && [ ! -x "$libvirtd" ]; then
+-            echo $"libvirtd not installed; skipping this URI."
++            echo "libvirtd not installed; skipping this URI."
+             continue
+         fi
+ 
+@@ -249,7 +236,7 @@ stop() {
+                 empty=false
+             done
+             if $empty; then
+-                echo $"no running guests."
++                echo "no running guests."
+             else
+                 echo
+                 echo $uri $list >>"$LISTFILE"
+@@ -259,9 +246,9 @@ stop() {
+ 
+     while read uri list; do
+         if $suspending; then
+-            echo $"Suspending guests on $uri URI..."
++            echo "Suspending guests on $uri URI..."
+         else
+-            echo $"Shutting down guests on $uri URI..."
++            echo "Shutting down guests on $uri URI..."
+         fi
+ 
+         for guest in $list; do
+@@ -285,17 +272,16 @@ 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
+-        echo $"stopped, with saved guests"
++        echo "stopped, with saved guests"
+         RETVAL=3
+     else
+         if [ -f "$VAR_SUBSYS_LIBVIRT_GUESTS" ]; then
+-            echo $"started"
++            echo "started"
+         else
+-            echo $"stopped, with no saved guests"
++            echo "stopped, with no saved guests"
+         fi
+         RETVAL=0
+     fi
+@@ -304,7 +290,7 @@ rh_status() {
+ # usage [val]
+ # Display usage string, then exit with VAL (defaults to 2).
+ usage() {
+-    echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|gueststatus|shutdown}"
++    echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|gueststatus|shutdown}"
+     exit ${1-2}
+ }
+ 
+diff --git a/tools/libvirt-guests.sysconf b/tools/libvirt-guests.sysconf
+index cd58728..53d89bd 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
+ 
+ # action taken on host shutdown
+ # - suspend   all running guests are suspended using virsh managedsave
+@@ -18,7 +18,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 seconds we're willing to wait for a guest to shut down
+-#SHUTDOWN_TIMEOUT=0
++#SHUTDOWN_TIMEOUT=30
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 042ec67..9448cf4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@
 0007-Disable-CHECKSUM-rule.patch
 0008-syntax-error-Bad-fd-number-when-stopping-libvirt-gue.patch
 0009-Missing-Default-Stop-field-in-LSB-comment-in-libvirt.patch
+0010-Debianize-libvirt-guests.patch

-- 
Libvirt Debian packaging



More information about the Pkg-libvirt-commits mailing list