]> xenbits.xensource.com Git - raisin.git/commitdiff
Fix libvirt initscript starting/stopping
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Sun, 29 Mar 2015 01:29:44 +0000 (18:29 -0700)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Sun, 29 Mar 2015 01:29:44 +0000 (18:29 -0700)
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 <stefano.stabellini@eu.citrix.com>
common-functions.sh
components/libvirt

index f6c0de35f0a5f030aaa740fc3580ae40ee33cc60..b3993cac4119286e81a2fcabc3f09f188ad7ce4a 100644 (file)
@@ -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"
index d422f3632dd9f35aa25b92356f09e4785da417be..6809b5ae6c1c4bfa754a73a0aac921d33964cdb1 100644 (file)
@@ -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
 }