-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I attached a small patch to the OCF resource agent to make it work with
the last CVS. It's not particularily well tested, but it's simple enough
and I haven't come across problems with it yet, so I don't expect any
trouble with it.

Hope you can use it

Regards,

Florian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEUM/wXxORI8q5gp0RAoPUAJ4hvOYiy3kKz6mD151LNheeoXUrKgCfWMrG
QSvFYFIdffQVeHQgxjA60RY=
=oLKu
-----END PGP SIGNATURE-----
--- src/heartbeat/cvs/linux-ha/resources/OCF/drbd       2006-04-27 
13:33:38.000000000 +0200
+++ drbd        2006-04-27 15:41:07.000000000 +0200
@@ -158,7 +158,7 @@
 
 drbd_init() {
        DRBDADM=$(which drbdadm 2>/dev/null)
-       CRM_MASTER=/usr/lib/heartbeat/crm_master
+       CRM_MASTER=/usr/sbin/crm_master
        
        if [ -z "$DRBDADM" -o ! -x "$DRBDADM" ]; then
                ocf_log err "drbdadm not installed."
@@ -309,24 +309,18 @@
 
        drbd_get_status
 
-       if [ "$DRBD_STATE_LOCAL" = "Not configured" ]; then
-               ocf_log debug "$RESOURCE monitor: resource not configured"
-               return $OCF_NOT_RUNNING
+       if [ "$DRBD_STATE_LOCAL" == "Not configured" ]; then
+           ocf_log debug "$RESOURCE monitor: resource not configured"
+           return $OCF_NOT_RUNNING
+       elif [ "$DRBD_STATE_LOCAL" == "Primary" ]; then
+           return $OCF_RUNNING_MASTER
+       elif [ "$DRBD_STATE_LOCAL" == "Secondary" ]; then
+           return $OCF_SUCCESS
+       else
+           ocf_log err "$RESOURCE monitor: unexpected local state: 
$DRBD_STATE_LOCAL"
        fi
        
-       if [ "$DRBD_STATE_LOCAL" != "Secondary" ] \
-       && [ "$DRBD_STATE_LOCAL" != "Primary" ]; then
-               ocf_log err "$RESOURCE monitor: unexpected local state: 
$DRBD_STATE_LOCAL"
-               return $OCF_ERR_GENERIC
-       fi
-
-       ROLE="$OCF_RESKEY_role"
-       if [ -n "$ROLE" ] && [ "$DRBD_STATE_LOCAL" != "$ROLE" ]; then
-               ocf_log err "$RESOURCE monitor: wrong state: expected $ROLE != 
$DRBD_STATE_LOCAL"
-               return $OCF_ERR_GENERIC
-       fi
-
-       return $OCF_SUCCESS
+       return $OCF_ERR_GENERIC
 }
 
 drbd_promote() {
@@ -411,7 +405,7 @@
        post)
                case $n_op in
                start)
-                       if [ "$n_active_count" -eq 2 ]; then
+                       if [ "$n_active" -eq 2 ]; then
                                # The other side is running, so we ought
                                # to connect and wait for that.
                                drbd_start_phase_2 yes
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to