2 * Unix SMB/CIFS implementation.
4 * Copyright (C) Volker Lendecke 2014
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "lib/messages_ctdb.h"
24 #include "lib/util/tevent_unix.h"
25 #include "lib/param/param.h"
27 int main(int argc
, const char *argv
[])
30 struct loadparm_context
*lp_ctx
= NULL
;
31 struct tevent_context
*ev
;
32 struct messaging_context
*msg
;
33 struct tevent_req
*req
;
37 talloc_enable_leak_report_full();
39 frame
= talloc_stackframe();
41 lp_ctx
= loadparm_init_s3(frame
, loadparm_s3_helpers());
44 "Failed to initialise the global parameter structure.\n");
48 setup_logging("notifyd", DEBUG_DEFAULT_STDOUT
);
49 lpcfg_set_cmdline(lp_ctx
, "log level", "10");
51 ok
= lp_load_initial_only(get_dyn_CONFIGFILE());
53 fprintf(stderr
, "Can't load %s - run testparm to debug it\n",
54 get_dyn_CONFIGFILE());
58 ev
= samba_tevent_context_init(frame
);
60 fprintf(stderr
, "samba_tevent_context_init failed\n");
64 msg
= messaging_init(ev
, ev
);
66 fprintf(stderr
, "messaging_init failed\n");
70 if (!lp_load_global(get_dyn_CONFIGFILE())) {
71 fprintf(stderr
, "Can't load %s - run testparm to debug it\n",
72 get_dyn_CONFIGFILE());
76 req
= notifyd_send(ev
, ev
, msg
, messaging_ctdb_connection(),
79 fprintf(stderr
, "notifyd_send failed\n");
83 ok
= tevent_req_poll_unix(req
, ev
, &err
);
85 fprintf(stderr
, "tevent_req_poll_unix failed: %s\n",
90 ret
= notifyd_recv(req
);
92 printf("notifyd_recv returned %d (%s)\n", ret
,
93 ret
? strerror(ret
) : "ok");