Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-support / drbd / drbd-utils / 0005-drbd_reconnect_standby_standalone.patch
1 Index: git/scripts/drbd.ocf
2 ===================================================================
3 --- git.orig/scripts/drbd.ocf
4 +++ git/scripts/drbd.ocf
5 @@ -418,6 +418,29 @@ drbd_condition() {
6              rc=$OCF_DATA_OUTDATED
7              ocf_log info "${OCF_RESKEY_drbd_resource} outdated"
8              ;;
9 +        Inconsistent)
10 +            case "${DRBD_CSTATE}" in
11 +                StandAlone)
12 +                    rc=$OCF_DATA_STANDALONE
13 +                    if [ $status -eq $OCF_SUCCESS ]
14 +                    then
15 +                        ocf_log info "${OCF_RESKEY_drbd_resource} standby standalone, attempting to reconnect."
16 +                        do_drbdadm connect ${OCF_RESKEY_drbd_resource}
17 +                    else
18 +                        ocf_log info "${OCF_RESKEY_drbd_resource} standalone"
19 +                    fi
20 +                    ;;
21 +                StartingSyncT | WFBitMapT | WFSyncUUID | SyncTarget | \
22 +                PausedSyncT)
23 +                    rc=$OCF_DATA_SYNC
24 +                    ocf_log info "${OCF_RESKEY_drbd_resource} sync"
25 +                    ;;
26 +                *)
27 +                    rc=$OCF_DATA_INCONSISTENT
28 +                    ocf_log info "${OCF_RESKEY_drbd_resource} inconsistent"
29 +                    ;;
30 +            esac
31 +            ;;
32          *)
33              case "${DRBD_CSTATE}" in
34                  StandAlone)