server: add updateip event
authorStefan Metzmacher <metze@samba.org>
Mon, 21 Dec 2009 07:33:55 +0000 (08:33 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 20 Jan 2010 10:11:01 +0000 (11:11 +0100)
metze

common/ctdb_util.c
config/events.d/README
include/ctdb.h
server/eventscript.c

index efc22de791ff4d398709fc927d9deb036a200390..5b31418e9cec11f8350666c576437f92b2f26f8f 100644 (file)
@@ -669,5 +669,6 @@ const char *ctdb_eventscript_call_names[] = {
        "monitor",
        "status",
        "shutdown",
-       "reload"
+       "reload",
+       "updateip"
 };
index b783efe4f55a101d4bc0733d22ea0b3ebc1209f1..f7b476ceda6e94c4f75308cd53341a835057876c 100644 (file)
@@ -114,6 +114,14 @@ releaseip
 
        Example: 60.nfs
 
+updateip
+       This event is triggered everytime the node moves a public ip
+       address between interfaces
+       This event takes four additional arguments :
+       'old-interface' 'new-interface' 'ipaddress' and 'netmask'
+
+       Example: 10.interface
+
 startrecovery
        This event is triggered everytime we start a recovery process
        or before we start changing ip address allocations.
index 4b2a002b302eb92a89336bb7d96e71eb3aae594a..9924acf8562eae67cb6962fbf9a051a627a86479 100644 (file)
@@ -690,6 +690,7 @@ enum ctdb_eventscript_call {
        CTDB_EVENT_STATUS,              /* Report service status: no args. */
        CTDB_EVENT_SHUTDOWN,            /* CTDB shutting down: no args. */
        CTDB_EVENT_RELOAD,              /* magic */
+       CTDB_EVENT_UPDATE_IP,           /* IP updating: old interface, new interface, IP address, netmask bits. */
        CTDB_EVENT_MAX
 };
 
index 56e1af50a64af4ac033eb29965e3da1a0f342699..36d87170d2d211c4377755589ab0e2866f6759f5 100644 (file)
@@ -604,6 +604,9 @@ static bool check_options(enum ctdb_eventscript_call call, const char *options)
        case CTDB_EVENT_RELEASE_IP:
                return count_words(options) == 3;
 
+       case CTDB_EVENT_UPDATE_IP: /* old interface, new interface, IP address, netmask bits. */
+               return count_words(options) == 4;
+
        default:
                DEBUG(DEBUG_ERR,(__location__ "Unknown ctdb_eventscript_call %u\n", call));
                return false;