From 837167c4c5568388e3ef2787de270e4423ad97f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20L=C3=A9onard?= Date: Thu, 9 Dec 2010 22:36:29 +0100 Subject: [PATCH] Debianize libvirt-guests Forwarded: not-needed Gbp-Pq: Topic debian Gbp-Pq: Name Debianize-libvirt-guests.patch --- docs/manpages/libvirt-guests.rst | 4 ++-- tools/libvirt-guests.sh.in | 21 ++++++++++----------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/docs/manpages/libvirt-guests.rst b/docs/manpages/libvirt-guests.rst index bea08e3bff..e52c8c1258 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 87f96af14d..9fe1c4cf74 100644 --- a/tools/libvirt-guests.sh.in +++ b/tools/libvirt-guests.sh.in @@ -20,30 +20,30 @@ sysconfdir="@sysconfdir@" localstatedir="@localstatedir@" libvirtd="@sbindir@"/libvirtd -# 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 BYPASS_CACHE=0 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 @@ -562,8 +562,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