]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
added --nosetsched option to ctdbd
authorAndrew Tridgell <tridge@samba.org>
Thu, 12 Jul 2007 22:47:02 +0000 (08:47 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 12 Jul 2007 22:47:02 +0000 (08:47 +1000)
(This used to be ctdb commit 4cbbb88c1735c7d112e751e22da1c1c69e09bf4a)

ctdb/config/functions
ctdb/include/ctdb_private.h
ctdb/server/ctdb_daemon.c
ctdb/server/ctdbd.c
ctdb/server/eventscript.c

index 7ca7327ab69cf3e81bb1b2b37091f556a5e65d59..d7818e0c469df3a7135d07c86c5fab1dfcc6faa9 100644 (file)
@@ -43,6 +43,7 @@ ctdb_wait_command() {
                echo "ctdb daemon has died. Exiting wait for $service_name"
                exit 1
          }
+         [ $all_ok -eq 1 ] || sleep 1
   done
   echo "`/bin/date` Local service $service_name is up"
 }
index bd64f978eb6626db2b4446f7bea868868a2d201a..b584794f1c9e14ec74a466b09e70e2c4a0192e39 100644 (file)
@@ -307,6 +307,7 @@ struct ctdb_context {
        struct ctdb_takeover takeover;
        struct ctdb_tcp_list *tcp_list;
        struct ctdb_client_ip *client_ip_list;
+       bool do_setsched;
 };
 
 struct ctdb_db_context {
index 25779700750a0996a7a23d32f039f435454789cb..ce84db3e685f0380ea783324abb47f3f97d879dd 100644 (file)
@@ -644,8 +644,10 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork)
        }
        block_signal(SIGPIPE);
 
-       /* try to set us up as realtime */
-       ctdb_set_realtime(true);
+       if (ctdb->do_setsched) {
+               /* try to set us up as realtime */
+               ctdb_set_realtime(true);
+       }
 
        /* ensure the socket is deleted on exit of the daemon */
        domain_socket_name = talloc_strdup(talloc_autofree_context(), ctdb->daemon.name);
index 2c4a23b67396aec371caedfcc2e4dfa66ad17966..91e4d8f70b24d67e0ca299375d56e86731d524a3 100644 (file)
@@ -47,6 +47,7 @@ static struct {
        const char *logfile;
        const char *recovery_lock_file;
        const char *db_dir;
+       int         no_setsched;
 } options = {
        .nlist = ETCDIR "/ctdb/nodes",
        .transport = "tcp",
@@ -108,6 +109,7 @@ int main(int argc, const char *argv[])
                { "transport", 0, POPT_ARG_STRING, &options.transport, 0, "protocol transport", NULL },
                { "dbdir", 0, POPT_ARG_STRING, &options.db_dir, 0, "directory for the tdb files", NULL },
                { "reclock", 0, POPT_ARG_STRING, &options.recovery_lock_file, 0, "location of recovery lock file", "filename" },
+               { "nosetsched", 0, POPT_ARG_NONE, &options.no_setsched, 0, "disable setscheduler SCHED_FIFO call", NULL },
                POPT_TABLEEND
        };
        int opt, ret;
@@ -224,6 +226,8 @@ int main(int argc, const char *argv[])
                talloc_free(name);
        }
 
+       ctdb->do_setsched = !!options.no_setsched;
+
        /* start the protocol running (as a child) */
        return ctdb_start_daemon(ctdb, interactive?False:True);
 }
index e23157056c8df60935eb5e2d92b3bd09ea9cbc20..fab9175ed290a8bbe535789ab84a6e5be89ea708 100644 (file)
@@ -166,7 +166,9 @@ int ctdb_event_script_callback(struct ctdb_context *ctdb,
 
        if (state->child == 0) {
                close(state->fd[0]);
-               ctdb_set_realtime(false);
+               if (ctdb->do_setsched) {
+                       ctdb_set_realtime(false);
+               }
                set_close_on_exec(state->fd[1]);
                va_start(ap, fmt);
                ret = ctdb_event_script_v(ctdb, fmt, ap);