smbstatus: always initialize a messaing context
[samba.git] / source3 / utils / status.c
index f81ab5f1e22f6318a93366f8fce9c59d85fd5cbb..8d84537c4955c483b87a26e7525e14735f11528d 100644 (file)
@@ -456,18 +456,15 @@ int main(int argc, const char *argv[])
        }
 
 
-       if (lp_clustering()) {
-               /*
-                * This implicitly initializes the global ctdbd
-                * connection, usable by the db_open() calls further
-                * down.
-                */
-               msg_ctx = messaging_init(NULL, samba_tevent_context_init(NULL));
-               if (msg_ctx == NULL) {
-                       fprintf(stderr, "messaging_init failed\n");
-                       ret = -1;
-                       goto done;
-               }
+       /*
+        * This implicitly initializes the global ctdbd connection,
+        * usable by the db_open() calls further down.
+        */
+       msg_ctx = messaging_init(NULL, samba_tevent_context_init(NULL));
+       if (msg_ctx == NULL) {
+               fprintf(stderr, "messaging_init failed\n");
+               ret = -1;
+               goto done;
        }
 
        if (!lp_load_global(get_dyn_CONFIGFILE())) {
@@ -582,16 +579,6 @@ int main(int argc, const char *argv[])
        if (show_notify) {
                struct notify_context *n;
 
-               if (msg_ctx == NULL) {
-                       msg_ctx = messaging_init(
-                               NULL, samba_tevent_context_init(NULL));
-                       if (msg_ctx == NULL) {
-                               fprintf(stderr, "messaging_init failed\n");
-                               ret = -1;
-                               goto done;
-                       }
-               }
-
                n = notify_init(talloc_tos(), msg_ctx,
                                messaging_tevent_context(msg_ctx));
                if (n == NULL) {