[Pkg-libvirt-commits] [SCM] Libvirt debian packaging branch, master, updated. debian/0.4.6-3-2-g86250d5
Guido Guenther
agx at sigxcpu.org
Sun Nov 2 10:03:40 UTC 2008
The following commit has been merged in the master branch:
commit 50b27f5197f7c864ee9c39af6952de2685e38516
Author: Guido Günther <agx at sigxcpu.org>
Date: Sat Nov 1 19:31:35 2008 +0100
add libvirt-suspendonreboot script
Closes: #501155
Thanks: Andreas Barth
diff --git a/debian/libvirt-bin.examples b/debian/libvirt-bin.examples
index f391728..156ce33 100644
--- a/debian/libvirt-bin.examples
+++ b/debian/libvirt-bin.examples
@@ -1,3 +1,5 @@
qemud/libvirtd.policy
qemud/libvirtd.sasl
qemud/libvirtd.conf
+debian/libvirt-suspendonreboot
+
diff --git a/debian/libvirt-suspendonreboot b/debian/libvirt-suspendonreboot
new file mode 100644
index 0000000..f23cf5d
--- /dev/null
+++ b/debian/libvirt-suspendonreboot
@@ -0,0 +1,41 @@
+#! /bin/bash
+
+# (c) Andi Barth <aba at not.so.argh.org> 2008
+# Distributable under the terms of the GNU GPL version 2.
+#
+# copy to /etc/init.d/libvirt-suspendonreboot and use
+# update-rc.d libvirt-suspendonreboot defaults 21 19
+# to enable
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+suspenddir=/var/lib/libvirt/autosuspend
+
+case "$1" in
+ start)
+ for domain in ${suspenddir}/*dump; do
+ if [ -f $domain ]; then
+ domain=$(basename $domain .dump)
+ echo "resuming $domain ..."
+ virsh restore ${suspenddir}/${domain}.dump && rm ${suspenddir}/${domain}.dump
+ fi
+ done
+ ;;
+ stop)
+ for domain in /etc/libvirt/qemu/*xml; do
+ domain=$(basename $domain .xml)
+ state=$(virsh domstate $domain)
+ if [ "$state" == "running" ]; then
+ echo "suspending $domain ..."
+ virsh save ${domain} ${suspenddir}/${domain}.dump
+ fi
+ done
+ ;;
+ reload|force-reload|restart)
+ # No action, nothing to reload
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
+ exit 1
+esac
+
--
Libvirt debian packaging
More information about the Pkg-libvirt-commits
mailing list