[NEW PATCH] [WIP] BZ#694026 initctl libvirtd as part of its configuration (via gerrit-bot)

Dan Kenigsberg danken at redhat.com
Thu Jul 7 16:12:04 UTC 2011


New patch submitted by Dan Kenigsberg (danken at redhat.com)

You can review this change at: http://gerrit.usersys.redhat.com/675

commit e5e01e1876704c5ff8cad77a6a8126a74b49b83c
Author: Sanjay Mehrotra <smehrotr at redhat.com>
Date:   Thu Jul 7 16:09:39 2011 +0300

    [WIP] BZ#694026  initctl libvirtd as part of its configuration
    
    Change-Id: I0ea7b64a710b6e2c48fb96da82ebea64fd0482a4

diff --git a/vdsm/vdsmd b/vdsm/vdsmd
index 6b35e23..53705b3 100755
--- a/vdsm/vdsmd
+++ b/vdsm/vdsmd
@@ -30,7 +30,7 @@ RESPAWNPIDFILE=@P_VDSM_RUN@/respawn.pid
 CORE_DUMP_PATH=/var/log/core/core.%p.%t.dump
 DOM_METADATA_BACKUP_DIR=/var/log/vdsm/backup
 CORE_PATTERN=/proc/sys/kernel/core_pattern
-NEEDED_SERVICES="iscsid multipathd libvirtd"
+NEEDED_SERVICES="iscsid multipathd"
 CONFLICTING_SERVICES="libvirt-guests"
 # TODO: Remove cpu cgroup disabling when BZ#623712 is resolved (kernel on
 # massively multicore platforms failing to scale with cgroups turned on)
@@ -323,8 +323,6 @@ configure_libvirt()
 virt_use_nfs=1
 _EOF
     /usr/sbin/setsebool virt_use_nfs on
-
-    service libvirtd condrestart
 }
 
 RETVAL=0
@@ -343,26 +341,47 @@ reconfigure() {
     configure_libvirt $args
 }
 
+start_libvirtd() {
+    if ! initctl list | grep -q libvirtd
+    then
+       chkconfig libvirtd off && service libvirtd stop >/dev/null 2>&1
+       cp -f /etc/vdsm/libvirtd.upstart /etc/init/libvirtd.conf
+       initctl reload-configuration && initctl start libvirtd
+    fi
+
+    initctl status libvirtd | grep -q "libvirtd start" && return 0;
+
+    if initctl status libvirtd | grep -q "libvirtd stop"
+    then
+       initctl start libvirtd
+    else
+       service libvirtd condrestart
+       chkconfig libvirtd on
+    fi
+}
+
 start() {
     local ret_val
     python @P_VDSM@/hooks.pyc before_vdsm_start
 
-    reconfigure noforce
+    start_needed_srv
     ret_val=$?
     if [ $ret_val -ne 0 ]
     then
-        log_failure_msg "$prog: failed to reconfigure libvirt"
-        return $ret_val
+       log_failure_msg "$prog: one of the dependent services did not start, error code $ret_val"
+       return $ret_val
     fi
 
-    start_needed_srv
+    reconfigure noforce
     ret_val=$?
     if [ $ret_val -ne 0 ]
     then
-       log_failure_msg "$prog: one of the dependent services did not start, error code $ret_val"
-       return $ret_val
+        log_failure_msg "$prog: failed to reconfigure libvirt"
+        return $ret_val
     fi
 
+    start_libvirtd
+
     shutdown_conflicting_srv
     @P_VDSM@/vdsm-restore-net-config
     load_needed_modules




More information about the vdsm-patches mailing list