From b7e8f7786a232b70dbb30757a01d9984cad3a4ee Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Sat, 28 Mar 2015 18:29:44 -0700 Subject: [PATCH] Fix libvirt initscript starting/stopping Not all libvirt initscripts are installed on Debian. Only install libvirt-guests and virtlockd on Fedora and CentOS. Also remove the check on the existence of initscripts from start_initscripts/stop_initscripts. Signed-off-by: Stefano Stabellini --- common-functions.sh | 10 ---------- components/libvirt | 12 ++++++++++-- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/common-functions.sh b/common-functions.sh index f6c0de3..b3993ca 100644 --- a/common-functions.sh +++ b/common-functions.sh @@ -138,11 +138,6 @@ function install_dependencies() { function start_initscripts() { while test $# -ge 1 do - if test ! -f $1 - then - shift 1 - continue - fi case $DISTRO in "Debian" ) $SUDO update-rc.d $1 defaults || echo "Couldn't set $1 to start" @@ -162,11 +157,6 @@ function start_initscripts() { function stop_initscripts() { while test $# -ge 1 do - if test ! -f $1 - then - shift 1 - continue - fi case $DISTRO in "Debian" ) $SUDO update-rc.d $1 remove || echo "Couldn't remove $1 from init" diff --git a/components/libvirt b/components/libvirt index d422f36..6809b5a 100644 --- a/components/libvirt +++ b/components/libvirt @@ -70,9 +70,17 @@ function libvirt_clean() { } function libvirt_configure() { - start_initscripts libvirtd libvirt-guests virtlockd + start_initscripts libvirtd + if test $DISTRO = "Fedora" || test $DISTRO = "CentOS" + then + start_initscripts libvirt-guests virtlockd + fi } function libvirt_unconfigure() { - stop_initscripts libvirtd libvirt-guests virtlockd + stop_initscripts libvirtd + if test $DISTRO = "Fedora" || test $DISTRO = "CentOS" + then + stop_initscripts libvirt-guests virtlockd + fi } -- 2.39.5