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
|
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
Forwarded: not-needed
---
docs/manpages/libvirt-guests.rst | 4 ++--
tools/libvirt-guests.sh.in | 15 +++++++--------
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/docs/manpages/libvirt-guests.rst b/docs/manpages/libvirt-guests.rst
index 42dae28..69bc270 100644
--- a/docs/manpages/libvirt-guests.rst
+++ b/docs/manpages/libvirt-guests.rst
@@ -51,7 +51,7 @@ The following variables are supported:
URIs to check for running guests. Example:
``URIS='default xen:///system xen+tcp://host/system lxc:///system'``
-- ON_BOOT=start
+- ON_BOOT=ignore
Action taken on host boot
@@ -70,7 +70,7 @@ The following variables are supported:
Number of seconds to wait between each guest start. Set to 0 to allow parallel
startup.
-- ON_SHUTDOWN=suspend
+- ON_SHUTDOWN=shutdown
Action taken on host shutdown
diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
index f2db128..e2a3744 100644
--- a/tools/libvirt-guests.sh.in
+++ b/tools/libvirt-guests.sh.in
@@ -20,19 +20,19 @@ sysconfdir="@sysconfdir@"
localstatedir="@localstatedir@"
initconfdir="@initconfdir@"
-# Source function library.
-test ! -r "$sysconfdir"/rc.d/init.d/functions ||
- . "$sysconfdir"/rc.d/init.d/functions
-
# Source gettext library.
# Make sure this file is recognized as having translations: _("dummy")
. "@bindir@"/gettext.sh
+# Make sure calls to this script get redirected to systemctl when
+# using systemd
+. /lib/lsb/init-functions
+
export TEXTDOMAIN="@PACKAGE@" TEXTDOMAINDIR="@localedir@"
URIS="default"
-ON_BOOT="start"
-ON_SHUTDOWN="suspend"
+ON_BOOT="ignore"
+ON_SHUTDOWN="shutdown"
SHUTDOWN_TIMEOUT=300
PARALLEL_SHUTDOWN=0
START_DELAY=0
@@ -585,8 +585,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
|