CVSROOT:        /cvs/cluster
Module name:    conga
Branch:         RHEL5
Changes by:     [EMAIL PROTECTED]       2007-08-20 16:23:28

Modified files:
        .              : clustermon.spec.in.in conga.spec.in.in 
        ricci/modules/cluster: Clusvcadm.cpp 

Log message:
        fix bz253341: failure to start cluster service which had been modifed 
for correction

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/clustermon.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.18.2.23&r2=1.18.2.24
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.45.2.56&r2=1.45.2.57
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Clusvcadm.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7.2.5&r2=1.7.2.6

--- conga/clustermon.spec.in.in 2007/08/13 19:06:01     1.18.2.23
+++ conga/clustermon.spec.in.in 2007/08/20 16:23:27     1.18.2.24
@@ -193,6 +193,10 @@
 
 
 %changelog
+* Mon Aug 20 2007 Ryan McCabe <[EMAIL PROTECTED]> 0.10.0-5
+- Fixed bz253341 (failure to start cluster service which had been modifed for 
correction)
+- Resolves: bz253341
+
 * Wed Aug 08 2007 Ryan McCabe <[EMAIL PROTECTED]> 0.10.0-4
 - Fixed bz230451 (fence_xvm.key file is not automatically created. Should have 
a least a default)
 - Resolves: bz230451
--- conga/conga.spec.in.in      2007/08/17 20:26:31     1.45.2.56
+++ conga/conga.spec.in.in      2007/08/20 16:23:27     1.45.2.57
@@ -310,8 +310,10 @@
 
 ###  changelog ###
 %changelog
-* Fri Aug 17 2007 Ryan McCabe <[EMAIL PROTECTED]> 0.10.0-5
-* Fixed bz249291 (delete node task fails to do all items listed in the help 
document)
+* Mon Aug 20 2007 Ryan McCabe <[EMAIL PROTECTED]> 0.10.0-5
+- Fixed bz249291 (delete node task fails to do all items listed in the help 
document)
+- Fixed bz253341 (failure to start cluster service which had been modifed for 
correction)
+- Related: bz253341
 - Resolves: bz249291
 
 * Mon Aug 13 2007 Ryan McCabe <[EMAIL PROTECTED]> 0.10.0-4
--- conga/ricci/modules/cluster/Clusvcadm.cpp   2007/03/12 03:45:57     1.7.2.5
+++ conga/ricci/modules/cluster/Clusvcadm.cpp   2007/08/20 16:23:28     1.7.2.6
@@ -1,5 +1,5 @@
 /*
-  Copyright Red Hat, Inc. 2005
+  Copyright Red Hat, Inc. 2005-2007
 
   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
@@ -89,7 +89,7 @@
     if (*iter == nodename)
       node_found = true;
   if (!node_found && nodename.size())
-    throw String("node unable to run services");
+    throw String("Node " + nodename + " is unable to run cluster services. 
Check whether the rgmanager service is running");
   
   // start
   for (list<ServiceStatus>::const_iterator iter = services.begin();
@@ -100,10 +100,20 @@
 
       if (iter->status == ServiceStatus::RG_STATE_MIGRATE)
          throw String(servicename + " is in the process of being migrated");
-               
-      if (iter->status == ServiceStatus::RG_STATE_STOPPED ||
+
+      /*
+      ** Failed services must be disabled before they can be
+      ** started again.
+      */
+      if (iter->status == ServiceStatus::RG_STATE_FAILED) {
+        try {
+          Clusvcadm::stop(servicename);
+        } catch ( ... ) {
+          throw String("Unable to disable failed service " + servicename + " 
before starting it");
+        }
+        flag = "-e";
+      } else if (iter->status == ServiceStatus::RG_STATE_STOPPED ||
          iter->status == ServiceStatus::RG_STATE_STOPPING ||
-         iter->status == ServiceStatus::RG_STATE_FAILED ||
          iter->status == ServiceStatus::RG_STATE_ERROR ||
          iter->status == ServiceStatus::RG_STATE_DISABLED)
        flag = "-e";
@@ -127,12 +137,12 @@
        if (utils::execute(CLUSVCADM_TOOL_PATH, args, out, err, status, false))
          throw command_not_found_error_msg(CLUSVCADM_TOOL_PATH);
        if (status != 0)
-         throw String("clusvcadm failed");
+         throw String("clusvcadm failed to start " + servicename);
       }
       return;
     }
   
-  throw String("no such service");
+  throw String(servicename + ": no such cluster service");
 }
 
 void 
@@ -150,7 +160,7 @@
     if (*iter == nodename)
       node_found = true;
   if (!node_found && nodename.size())
-    throw String("node unable to run services");
+    throw String("Node " + nodename + " is unable to run cluster services. 
Check whether the rgmanager service is running");
   
   // start
   for (list<ServiceStatus>::const_iterator iter = services.begin();
@@ -162,9 +172,16 @@
       String flag;
       if (iter->status == ServiceStatus::RG_STATE_MIGRATE)
          throw String(servicename + " is already in the process of being 
migrated");
-      if (iter->status == ServiceStatus::RG_STATE_STOPPED ||
+
+      if (iter->status == ServiceStatus::RG_STATE_FAILED) {
+        try {
+          Clusvcadm::stop(servicename);
+        } catch ( ... ) {
+          throw String("Unable to disable failed service " + servicename + " 
before starting it");
+        }
+        flag = "-e";
+      } else if (iter->status == ServiceStatus::RG_STATE_STOPPED ||
          iter->status == ServiceStatus::RG_STATE_STOPPING ||
-         iter->status == ServiceStatus::RG_STATE_FAILED ||
          iter->status == ServiceStatus::RG_STATE_ERROR ||
          iter->status == ServiceStatus::RG_STATE_DISABLED)
        flag = "-e";
@@ -185,13 +202,13 @@
        if (utils::execute(CLUSVCADM_TOOL_PATH, args, out, err, status, false))
          throw command_not_found_error_msg(CLUSVCADM_TOOL_PATH);
        if (status != 0)
-         throw String("clusvcadm failed");
+         throw String("clusvcadm failed to migrate " + servicename);
       }
       return;
     }
   }
   
-  throw String("no such virtual service");
+  throw String(servicename + ": no such virtual machine service");
 }
 
 void 
@@ -206,6 +223,7 @@
        iter++)
     if (iter->name == servicename) {
       if (iter->status == ServiceStatus::RG_STATE_STARTING ||
+          iter->status == ServiceStatus::RG_STATE_FAILED   ||
          iter->status == ServiceStatus::RG_STATE_STARTED) {
        String out, err;
        int status;
@@ -218,12 +236,12 @@
        if (utils::execute(CLUSVCADM_TOOL_PATH, args, out, err, status, false))
          throw command_not_found_error_msg(CLUSVCADM_TOOL_PATH);
        if (status != 0)
-         throw String("clusvcadm failed");
+         throw String("clusvcadm failed to stop " + servicename);
       }
       return;
     }
   
-  throw String("no such service");
+  throw String(servicename + ": no such cluster service");
 }
 
 void 
@@ -243,9 +261,15 @@
       if (iter->status == ServiceStatus::RG_STATE_STARTING)
          throw String(servicename + " is in the process of being started");
 
-      if (iter->status == ServiceStatus::RG_STATE_STOPPED ||
+      if (iter->status == ServiceStatus::RG_STATE_FAILED) {
+        try {
+          Clusvcadm::stop(servicename);
+        } catch ( ... ) {
+          throw String("Unable to disable failed service " + servicename + " 
before starting it");
+        }
+        flag = "-e";
+      } else if (iter->status == ServiceStatus::RG_STATE_STOPPED ||
          iter->status == ServiceStatus::RG_STATE_STOPPING ||
-         iter->status == ServiceStatus::RG_STATE_FAILED ||
          iter->status == ServiceStatus::RG_STATE_ERROR ||
          iter->status == ServiceStatus::RG_STATE_DISABLED)
        flag = "-e";
@@ -264,12 +288,12 @@
        if (utils::execute(CLUSVCADM_TOOL_PATH, args, out, err, status, false))
          throw command_not_found_error_msg(CLUSVCADM_TOOL_PATH);
        if (status != 0)
-         throw String("clusvcadm failed");
+         throw String("clusvcadm failed to restart cluster service " + 
servicename);
       }
       return;
     }
   
-  throw String("no such service");
+  throw String(servicename + ": no such cluster service");
 }
 
 

Reply via email to