1 /* Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
25 #include "command-line.h"
29 #include "dynamic-string.h"
34 #include "jsonrpc-server.h"
35 #include "leak-checker.h"
39 #include "ovsdb-data.h"
40 #include "ovsdb-types.h"
41 #include "ovsdb-error.h"
42 #include "poll-loop.h"
46 #include "stream-ssl.h"
52 #include "transaction.h"
58 VLOG_DEFINE_THIS_MODULE(ovsdb_server);
61 /* Initialized in main(). */
63 struct ovsdb_file *file;
66 /* Only used by update_remote_status(). */
67 struct ovsdb_txn *txn;
70 /* SSL configuration. */
71 static char *private_key_file;
72 static char *certificate_file;
73 static char *ca_cert_file;
74 static bool bootstrap_ca_cert;
76 static unixctl_cb_func ovsdb_server_exit;
77 static unixctl_cb_func ovsdb_server_compact;
78 static unixctl_cb_func ovsdb_server_reconnect;
80 static void parse_options(int *argc, char **argvp[],
81 struct sset *remotes, char **unixctl_pathp,
83 static void usage(void) NO_RETURN;
85 static void reconfigure_from_db(struct ovsdb_jsonrpc_server *jsonrpc,
86 const struct db dbs[], size_t n_dbs,
87 struct sset *remotes);
89 static void update_remote_status(const struct ovsdb_jsonrpc_server *jsonrpc,
90 const struct sset *remotes,
91 struct db dbs[], size_t n_dbs);
94 main(int argc, char *argv[])
96 char *unixctl_path = NULL;
97 char *run_command = NULL;
98 struct unixctl_server *unixctl;
99 struct ovsdb_jsonrpc_server *jsonrpc;
101 struct process *run_process;
104 long long int status_timer = LLONG_MIN;
110 proctitle_init(argc, argv);
111 set_program_name(argv[0]);
112 stress_init_command();
113 signal(SIGPIPE, SIG_IGN);
116 parse_options(&argc, &argv, &remotes, &unixctl_path, &run_command);
120 n_dbs = MAX(1, argc);
121 dbs = xcalloc(n_dbs + 1, sizeof *dbs);
123 for (i = 0; i < argc; i++) {
124 dbs[i].filename = argv[i];
127 dbs[0].filename = xasprintf("%s/conf.db", ovs_dbdir());
130 for (i = 0; i < n_dbs; i++) {
131 struct ovsdb_error *error;
133 error = ovsdb_file_open(dbs[i].filename, false,
134 &dbs[i].db, &dbs[i].file);
136 ovs_fatal(0, "%s", ovsdb_error_to_string(error));
140 jsonrpc = ovsdb_jsonrpc_server_create();
141 for (i = 0; i < n_dbs; i++) {
142 if (!ovsdb_jsonrpc_server_add_db(jsonrpc, dbs[i].db)) {
143 ovs_fatal(0, "%s: duplicate database name",
144 dbs[i].db->schema->name);
147 reconfigure_from_db(jsonrpc, dbs, n_dbs, &remotes);
149 retval = unixctl_server_create(unixctl_path, &unixctl);
157 run_argv[0] = "/bin/sh";
159 run_argv[2] = run_command;
162 retval = process_start(run_argv, NULL, 0, NULL, 0, &run_process);
164 ovs_fatal(retval, "%s: process failed to start", run_command);
170 daemonize_complete();
173 /* ovsdb-server is usually a long-running process, in which case it
174 * makes plenty of sense to log the version, but --run makes
175 * ovsdb-server more like a command-line tool, so skip it. */
176 VLOG_INFO("%s (Open vSwitch) %s", program_name, VERSION);
179 unixctl_command_register("exit", "", 0, 0, ovsdb_server_exit, &exiting);
180 unixctl_command_register("ovsdb-server/compact", "", 0, 1,
181 ovsdb_server_compact, dbs);
182 unixctl_command_register("ovsdb-server/reconnect", "", 0, 0,
183 ovsdb_server_reconnect, jsonrpc);
190 if (memory_should_report()) {
194 ovsdb_jsonrpc_server_get_memory_usage(jsonrpc, &usage);
195 for (i = 0; i < n_dbs; i++) {
196 ovsdb_get_memory_usage(dbs[i].db, &usage);
198 memory_report(&usage);
199 simap_destroy(&usage);
202 reconfigure_from_db(jsonrpc, dbs, n_dbs, &remotes);
203 ovsdb_jsonrpc_server_run(jsonrpc);
204 unixctl_server_run(unixctl);
206 for (i = 0; i < n_dbs; i++) {
207 ovsdb_trigger_run(dbs[i].db, time_msec());
209 if (run_process && process_exited(run_process)) {
213 /* update Manager status(es) every 5 seconds */
214 if (time_msec() >= status_timer) {
215 status_timer = time_msec() + 5000;
216 update_remote_status(jsonrpc, &remotes, dbs, n_dbs);
220 ovsdb_jsonrpc_server_wait(jsonrpc);
221 unixctl_server_wait(unixctl);
222 for (i = 0; i < n_dbs; i++) {
223 ovsdb_trigger_wait(dbs[i].db, time_msec());
226 process_wait(run_process);
229 poll_immediate_wake();
231 poll_timer_wait_until(status_timer);
234 ovsdb_jsonrpc_server_destroy(jsonrpc);
235 for (i = 0; i < n_dbs; i++) {
236 ovsdb_destroy(dbs[i].db);
238 sset_destroy(&remotes);
239 unixctl_server_destroy(unixctl);
241 if (run_process && process_exited(run_process)) {
242 int status = process_status(run_process);
244 ovs_fatal(0, "%s: child exited, %s",
245 run_command, process_status_msg(status));
252 static const struct db *
253 find_db(const struct db dbs[], size_t n_dbs, const char *db_name)
257 for (i = 0; i < n_dbs; i++) {
258 if (!strcmp(dbs[i].db->schema->name, db_name)) {
267 parse_db_column(const struct db dbs[], size_t n_dbs,
269 const struct db **dbp,
270 const struct ovsdb_table **tablep,
271 const struct ovsdb_column **columnp)
273 const char *table_name, *column_name;
274 const struct ovsdb_column *column;
275 const struct ovsdb_table *table;
276 const char *tokens[3];
277 char *save_ptr = NULL;
281 name = xstrdup(name_);
282 strtok_r(name, ":", &save_ptr); /* "db:" */
283 tokens[0] = strtok_r(NULL, ",", &save_ptr);
284 tokens[1] = strtok_r(NULL, ",", &save_ptr);
285 tokens[2] = strtok_r(NULL, ",", &save_ptr);
286 if (!tokens[0] || !tokens[1]) {
287 ovs_fatal(0, "\"%s\": invalid syntax", name_);
290 const char *db_name = tokens[0];
291 table_name = tokens[1];
292 column_name = tokens[2];
294 db = find_db(dbs, n_dbs, tokens[0]);
296 ovs_fatal(0, "\"%s\": no database named %s", name_, db_name);
300 ovs_fatal(0, "\"%s\": database name must be specified (because "
301 "multiple databases are configured)", name_);
304 table_name = tokens[0];
305 column_name = tokens[1];
309 table = ovsdb_get_table(db->db, table_name);
311 ovs_fatal(0, "\"%s\": no table named %s", name_, table_name);
314 column = ovsdb_table_schema_get_column(table->schema, column_name);
316 ovs_fatal(0, "\"%s\": table \"%s\" has no column \"%s\"",
317 name_, table_name, column_name);
327 parse_db_string_column(const struct db dbs[], size_t n_dbs,
329 const struct db **dbp,
330 const struct ovsdb_table **tablep,
331 const struct ovsdb_column **columnp)
333 const struct ovsdb_column *column;
334 const struct ovsdb_table *table;
337 parse_db_column(dbs, n_dbs, name, &db, &table, &column);
339 if (column->type.key.type != OVSDB_TYPE_STRING
340 || column->type.value.type != OVSDB_TYPE_VOID) {
341 ovs_fatal(0, "\"%s\": table \"%s\" column \"%s\" is "
342 "not string or set of strings",
343 name, table->schema->name, column->name);
351 static OVS_UNUSED const char *
352 query_db_string(const struct db dbs[], size_t n_dbs, const char *name)
354 if (!name || strncmp(name, "db:", 3)) {
357 const struct ovsdb_column *column;
358 const struct ovsdb_table *table;
359 const struct ovsdb_row *row;
362 parse_db_string_column(dbs, n_dbs, name, &db, &table, &column);
364 HMAP_FOR_EACH (row, hmap_node, &table->rows) {
365 const struct ovsdb_datum *datum;
368 datum = &row->fields[column->index];
369 for (i = 0; i < datum->n; i++) {
370 if (datum->keys[i].string[0]) {
371 return datum->keys[i].string;
379 static struct ovsdb_jsonrpc_options *
380 add_remote(struct shash *remotes, const char *target)
382 struct ovsdb_jsonrpc_options *options;
384 options = shash_find_data(remotes, target);
386 options = ovsdb_jsonrpc_default_options(target);
387 shash_add(remotes, target, options);
393 static struct ovsdb_datum *
394 get_datum(struct ovsdb_row *row, const char *column_name,
395 const enum ovsdb_atomic_type key_type,
396 const enum ovsdb_atomic_type value_type,
399 static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
400 const struct ovsdb_table_schema *schema = row->table->schema;
401 const struct ovsdb_column *column;
403 column = ovsdb_table_schema_get_column(schema, column_name);
405 VLOG_DBG_RL(&rl, "Table `%s' has no `%s' column",
406 schema->name, column_name);
410 if (column->type.key.type != key_type
411 || column->type.value.type != value_type
412 || column->type.n_max != n_max) {
413 if (!VLOG_DROP_DBG(&rl)) {
414 char *type_name = ovsdb_type_to_english(&column->type);
415 VLOG_DBG("Table `%s' column `%s' has type %s, not expected "
416 "key type %s, value type %s, max elements %zd.",
417 schema->name, column_name, type_name,
418 ovsdb_atomic_type_to_string(key_type),
419 ovsdb_atomic_type_to_string(value_type),
426 return &row->fields[column->index];
429 /* Read string-string key-values from a map. Returns the value associated with
430 * 'key', if found, or NULL */
432 read_map_string_column(const struct ovsdb_row *row, const char *column_name,
435 const struct ovsdb_datum *datum;
436 union ovsdb_atom *atom_key = NULL, *atom_value = NULL;
439 datum = get_datum(CONST_CAST(struct ovsdb_row *, row), column_name,
440 OVSDB_TYPE_STRING, OVSDB_TYPE_STRING, UINT_MAX);
446 for (i = 0; i < datum->n; i++) {
447 atom_key = &datum->keys[i];
448 if (!strcmp(atom_key->string, key)){
449 atom_value = &datum->values[i];
454 return atom_value ? atom_value->string : NULL;
457 static const union ovsdb_atom *
458 read_column(const struct ovsdb_row *row, const char *column_name,
459 enum ovsdb_atomic_type type)
461 const struct ovsdb_datum *datum;
463 datum = get_datum(CONST_CAST(struct ovsdb_row *, row), column_name, type,
465 return datum && datum->n ? datum->keys : NULL;
469 read_integer_column(const struct ovsdb_row *row, const char *column_name,
470 long long int *integerp)
472 const union ovsdb_atom *atom;
474 atom = read_column(row, column_name, OVSDB_TYPE_INTEGER);
475 *integerp = atom ? atom->integer : 0;
480 read_string_column(const struct ovsdb_row *row, const char *column_name,
481 const char **stringp)
483 const union ovsdb_atom *atom;
485 atom = read_column(row, column_name, OVSDB_TYPE_STRING);
486 *stringp = atom ? atom->string : NULL;
491 write_bool_column(struct ovsdb_row *row, const char *column_name, bool value)
493 const struct ovsdb_column *column;
494 struct ovsdb_datum *datum;
496 column = ovsdb_table_schema_get_column(row->table->schema, column_name);
497 datum = get_datum(row, column_name, OVSDB_TYPE_BOOLEAN,
504 ovsdb_datum_destroy(datum, &column->type);
507 datum->keys = xmalloc(sizeof *datum->keys);
508 datum->values = NULL;
511 datum->keys[0].boolean = value;
515 write_string_string_column(struct ovsdb_row *row, const char *column_name,
516 char **keys, char **values, size_t n)
518 const struct ovsdb_column *column;
519 struct ovsdb_datum *datum;
522 column = ovsdb_table_schema_get_column(row->table->schema, column_name);
523 datum = get_datum(row, column_name, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING,
529 /* Free existing data. */
530 ovsdb_datum_destroy(datum, &column->type);
532 /* Allocate space for new values. */
534 datum->keys = xmalloc(n * sizeof *datum->keys);
535 datum->values = xmalloc(n * sizeof *datum->values);
537 for (i = 0; i < n; ++i) {
538 datum->keys[i].string = keys[i];
539 datum->values[i].string = values[i];
542 /* Sort and check constraints. */
543 ovsdb_datum_sort_assert(datum, column->type.key.type);
546 /* Adds a remote and options to 'remotes', based on the Manager table row in
549 add_manager_options(struct shash *remotes, const struct ovsdb_row *row)
551 static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
552 struct ovsdb_jsonrpc_options *options;
553 long long int max_backoff, probe_interval;
554 const char *target, *dscp_string;
556 if (!read_string_column(row, "target", &target) || !target) {
557 VLOG_INFO_RL(&rl, "Table `%s' has missing or invalid `target' column",
558 row->table->schema->name);
562 options = add_remote(remotes, target);
563 if (read_integer_column(row, "max_backoff", &max_backoff)) {
564 options->max_backoff = max_backoff;
566 if (read_integer_column(row, "inactivity_probe", &probe_interval)) {
567 options->probe_interval = probe_interval;
570 options->dscp = DSCP_DEFAULT;
571 dscp_string = read_map_string_column(row, "other_config", "dscp");
573 int dscp = atoi(dscp_string);
574 if (dscp >= 0 && dscp <= 63) {
575 options->dscp = dscp;
581 query_db_remotes(const char *name, const struct db dbs[], size_t n_dbs,
582 struct shash *remotes)
584 const struct ovsdb_column *column;
585 const struct ovsdb_table *table;
586 const struct ovsdb_row *row;
589 parse_db_column(dbs, n_dbs, name, &db, &table, &column);
591 if (column->type.key.type == OVSDB_TYPE_STRING
592 && column->type.value.type == OVSDB_TYPE_VOID) {
593 HMAP_FOR_EACH (row, hmap_node, &table->rows) {
594 const struct ovsdb_datum *datum;
597 datum = &row->fields[column->index];
598 for (i = 0; i < datum->n; i++) {
599 add_remote(remotes, datum->keys[i].string);
602 } else if (column->type.key.type == OVSDB_TYPE_UUID
603 && column->type.key.u.uuid.refTable
604 && column->type.value.type == OVSDB_TYPE_VOID) {
605 const struct ovsdb_table *ref_table = column->type.key.u.uuid.refTable;
606 HMAP_FOR_EACH (row, hmap_node, &table->rows) {
607 const struct ovsdb_datum *datum;
610 datum = &row->fields[column->index];
611 for (i = 0; i < datum->n; i++) {
612 const struct ovsdb_row *ref_row;
614 ref_row = ovsdb_table_get_row(ref_table, &datum->keys[i].uuid);
616 add_manager_options(remotes, ref_row);
624 update_remote_row(const struct ovsdb_row *row, struct ovsdb_txn *txn,
625 const struct ovsdb_jsonrpc_server *jsonrpc)
627 struct ovsdb_jsonrpc_remote_status status;
628 struct ovsdb_row *rw_row;
630 char *keys[8], *values[8];
633 /* Get the "target" (protocol/host/port) spec. */
634 if (!read_string_column(row, "target", &target)) {
635 /* Bad remote spec or incorrect schema. */
638 rw_row = ovsdb_txn_row_modify(txn, row);
639 ovsdb_jsonrpc_server_get_remote_status(jsonrpc, target, &status);
641 /* Update status information columns. */
642 write_bool_column(rw_row, "is_connected", status.is_connected);
645 keys[n] = xstrdup("state");
646 values[n++] = xstrdup(status.state);
648 if (status.sec_since_connect != UINT_MAX) {
649 keys[n] = xstrdup("sec_since_connect");
650 values[n++] = xasprintf("%u", status.sec_since_connect);
652 if (status.sec_since_disconnect != UINT_MAX) {
653 keys[n] = xstrdup("sec_since_disconnect");
654 values[n++] = xasprintf("%u", status.sec_since_disconnect);
656 if (status.last_error) {
657 keys[n] = xstrdup("last_error");
659 xstrdup(ovs_retval_to_string(status.last_error));
661 if (status.locks_held && status.locks_held[0]) {
662 keys[n] = xstrdup("locks_held");
663 values[n++] = xstrdup(status.locks_held);
665 if (status.locks_waiting && status.locks_waiting[0]) {
666 keys[n] = xstrdup("locks_waiting");
667 values[n++] = xstrdup(status.locks_waiting);
669 if (status.locks_lost && status.locks_lost[0]) {
670 keys[n] = xstrdup("locks_lost");
671 values[n++] = xstrdup(status.locks_lost);
673 if (status.n_connections > 1) {
674 keys[n] = xstrdup("n_connections");
675 values[n++] = xasprintf("%d", status.n_connections);
677 write_string_string_column(rw_row, "status", keys, values, n);
679 ovsdb_jsonrpc_server_free_remote_status(&status);
683 update_remote_rows(const struct db dbs[], size_t n_dbs,
684 const char *remote_name,
685 const struct ovsdb_jsonrpc_server *jsonrpc)
687 const struct ovsdb_table *table, *ref_table;
688 const struct ovsdb_column *column;
689 const struct ovsdb_row *row;
692 if (strncmp("db:", remote_name, 3)) {
696 parse_db_column(dbs, n_dbs, remote_name, &db, &table, &column);
698 if (column->type.key.type != OVSDB_TYPE_UUID
699 || !column->type.key.u.uuid.refTable
700 || column->type.value.type != OVSDB_TYPE_VOID) {
704 ref_table = column->type.key.u.uuid.refTable;
706 HMAP_FOR_EACH (row, hmap_node, &table->rows) {
707 const struct ovsdb_datum *datum;
710 datum = &row->fields[column->index];
711 for (i = 0; i < datum->n; i++) {
712 const struct ovsdb_row *ref_row;
714 ref_row = ovsdb_table_get_row(ref_table, &datum->keys[i].uuid);
716 update_remote_row(ref_row, db->txn, jsonrpc);
723 update_remote_status(const struct ovsdb_jsonrpc_server *jsonrpc,
724 const struct sset *remotes,
725 struct db dbs[], size_t n_dbs)
727 static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
731 for (i = 0; i < n_dbs; i++) {
732 dbs[i].txn = ovsdb_txn_create(dbs[i].db);
735 /* Iterate over --remote arguments given on command line. */
736 SSET_FOR_EACH (remote, remotes) {
737 update_remote_rows(dbs, n_dbs, remote, jsonrpc);
740 for (i = 0; i < n_dbs; i++) {
741 struct ovsdb_error *error = ovsdb_txn_commit(dbs[i].txn, false);
743 VLOG_ERR_RL(&rl, "Failed to update remote status: %s",
744 ovsdb_error_to_string(error));
745 ovsdb_error_destroy(error);
750 /* Reconfigures ovsdb-server based on information in the database. */
752 reconfigure_from_db(struct ovsdb_jsonrpc_server *jsonrpc,
753 const struct db dbs[], size_t n_dbs, struct sset *remotes)
755 struct shash resolved_remotes;
758 /* Configure remotes. */
759 shash_init(&resolved_remotes);
760 SSET_FOR_EACH (name, remotes) {
761 if (!strncmp(name, "db:", 3)) {
762 query_db_remotes(name, dbs, n_dbs, &resolved_remotes);
764 add_remote(&resolved_remotes, name);
767 ovsdb_jsonrpc_server_set_remotes(jsonrpc, &resolved_remotes);
768 shash_destroy_free_data(&resolved_remotes);
771 stream_ssl_set_key_and_cert(query_db_string(dbs, n_dbs, private_key_file),
772 query_db_string(dbs, n_dbs, certificate_file));
773 stream_ssl_set_ca_cert_file(query_db_string(dbs, n_dbs, ca_cert_file),
778 ovsdb_server_exit(struct unixctl_conn *conn, int argc OVS_UNUSED,
779 const char *argv[] OVS_UNUSED,
782 bool *exiting = exiting_;
784 unixctl_command_reply(conn, NULL);
788 ovsdb_server_compact(struct unixctl_conn *conn, int argc,
789 const char *argv[], void *dbs_)
791 struct db *dbs = dbs_;
797 for (db = dbs; db->filename != NULL; db++) {
798 const char *name = db->db->schema->name;
800 if (argc < 2 || !strcmp(argv[1], name)) {
801 struct ovsdb_error *error;
803 VLOG_INFO("compacting %s database by user request", name);
805 error = ovsdb_file_compact(db->file);
807 char *s = ovsdb_error_to_string(error);
808 ds_put_format(&reply, "%s\n", s);
817 unixctl_command_reply_error(conn, "no database by that name");
818 } else if (reply.length) {
819 unixctl_command_reply_error(conn, ds_cstr(&reply));
821 unixctl_command_reply(conn, NULL);
826 /* "ovsdb-server/reconnect": makes ovsdb-server drop all of its JSON-RPC
827 * connections and reconnect. */
829 ovsdb_server_reconnect(struct unixctl_conn *conn, int argc OVS_UNUSED,
830 const char *argv[] OVS_UNUSED, void *jsonrpc_)
832 struct ovsdb_jsonrpc_server *jsonrpc = jsonrpc_;
834 ovsdb_jsonrpc_server_reconnect(jsonrpc);
835 unixctl_command_reply(conn, NULL);
839 parse_options(int *argcp, char **argvp[],
840 struct sset *remotes, char **unixctl_pathp, char **run_command)
843 OPT_REMOTE = UCHAR_MAX + 1,
846 OPT_BOOTSTRAP_CA_CERT,
849 LEAK_CHECKER_OPTION_ENUMS,
852 static struct option long_options[] = {
853 {"remote", required_argument, NULL, OPT_REMOTE},
854 {"unixctl", required_argument, NULL, OPT_UNIXCTL},
855 {"run", required_argument, NULL, OPT_RUN},
856 {"help", no_argument, NULL, 'h'},
857 {"version", no_argument, NULL, 'V'},
860 LEAK_CHECKER_LONG_OPTIONS,
861 {"bootstrap-ca-cert", required_argument, NULL, OPT_BOOTSTRAP_CA_CERT},
862 {"private-key", required_argument, NULL, 'p'},
863 {"certificate", required_argument, NULL, 'c'},
864 {"ca-cert", required_argument, NULL, 'C'},
865 {"enable-dummy", optional_argument, NULL, OPT_ENABLE_DUMMY},
868 char *short_options = long_options_to_short_options(long_options);
870 char **argv = *argvp;
876 c = getopt_long(argc, argv, short_options, long_options, NULL);
883 sset_add(remotes, optarg);
887 *unixctl_pathp = optarg;
891 *run_command = optarg;
898 ovs_print_version(0, 0);
902 DAEMON_OPTION_HANDLERS
903 LEAK_CHECKER_OPTION_HANDLERS
906 private_key_file = optarg;
910 certificate_file = optarg;
914 ca_cert_file = optarg;
915 bootstrap_ca_cert = false;
918 case OPT_BOOTSTRAP_CA_CERT:
919 ca_cert_file = optarg;
920 bootstrap_ca_cert = true;
923 case OPT_ENABLE_DUMMY:
924 dummy_enable(optarg && !strcmp(optarg, "override"));
943 printf("%s: Open vSwitch database server\n"
944 "usage: %s [OPTIONS] [DATABASE...]\n"
945 "where each DATABASE is a database file in ovsdb format.\n"
946 "The default DATABASE, if none is given, is\n%s/conf.db.\n",
947 program_name, program_name, ovs_dbdir());
948 printf("\nJSON-RPC options (may be specified any number of times):\n"
949 " --remote=REMOTE connect or listen to REMOTE\n");
950 stream_usage("JSON-RPC", true, true, true);
953 printf("\nOther options:\n"
954 " --run COMMAND run COMMAND as subprocess then exit\n"
955 " --unixctl=SOCKET override default control socket name\n"
956 " -h, --help display this help message\n"
957 " -V, --version display version information\n");
958 leak_checker_usage();