#include "passdb.h"
#include "auth.h"
#include "messages.h"
-#include "messages_ctdbd.h"
+#include "messages_ctdb.h"
#include "smbprofile.h"
#include "lib/id_cache.h"
#include "lib/param/param.h"
#ifdef CLUSTER_SUPPORT
static int smbd_parent_ctdb_reconfigured(
+ struct tevent_context *ev,
uint32_t src_vnn, uint32_t dst_vnn, uint64_t dst_srvid,
const uint8_t *msg, size_t msglen, void *private_data)
{
struct tevent_req *req;
sys_notify_watch_fn sys_notify_watch = NULL;
struct sys_notify_context *sys_notify_ctx = NULL;
+ struct ctdbd_connection *ctdbd_conn = NULL;
if (lp_kernel_change_notify()) {
}
}
- req = notifyd_send(msg_ctx, ev, msg_ctx,
- messaging_ctdbd_connection(),
+ if (lp_clustering()) {
+ ctdbd_conn = messaging_ctdb_connection();
+ }
+
+ req = notifyd_send(msg_ctx, ev, msg_ctx, ctdbd_conn,
sys_notify_watch, sys_notify_ctx);
if (req == NULL) {
TALLOC_FREE(sys_notify_ctx);
struct tevent_req *req;
pid_t pid;
NTSTATUS status;
+ bool ok;
if (interactive) {
req = notifyd_req(msg, ev);
messaging_send(msg, pid_to_procid(getppid()), MSG_SMB_NOTIFY_STARTED,
NULL);
- return tevent_req_poll(req, ev);
+ ok = tevent_req_poll(req, ev);
+ if (!ok) {
+ DBG_WARNING("tevent_req_poll returned %s\n", strerror(errno));
+ exit(1);
+ }
+ exit(0);
}
static void notifyd_init_trigger(struct tevent_req *req);
#ifdef CLUSTER_SUPPORT
if (lp_clustering()) {
- struct ctdbd_connection *conn = messaging_ctdbd_connection();
+ struct ctdbd_connection *conn = messaging_ctdb_connection();
register_with_ctdbd(conn, CTDB_SRVID_RECONFIGURE,
smbd_parent_ctdb_reconfigured, msg_ctx);
struct poptOption long_options[] = {
POPT_AUTOHELP
{"daemon", 'D', POPT_ARG_NONE, NULL, OPT_DAEMON, "Become a daemon (default)" },
- {"interactive", 'i', POPT_ARG_NONE, NULL, OPT_INTERACTIVE, "Run interactive (not a daemon)"},
+ {"interactive", 'i', POPT_ARG_NONE, NULL, OPT_INTERACTIVE, "Run interactive (not a daemon) and log to stdout"},
{"foreground", 'F', POPT_ARG_NONE, NULL, OPT_FORK, "Run daemon in foreground (for daemontools, etc.)" },
{"no-process-group", '\0', POPT_ARG_NONE, NULL, OPT_NO_PROCESS_GROUP, "Don't create a new process group" },
{"log-stdout", 'S', POPT_ARG_NONE, NULL, OPT_LOG_STDOUT, "Log to stdout" },