Changeset: 28055b54a004 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=28055b54a004
Modified Files:
tools/merovingian/daemon/argvcmds.c
tools/merovingian/daemon/monetdbd.1.in
Branch: Apr2011
Log Message:
monetdbd: allow changing ports in use with a single set command
automatically also change discoveryport and controlport when port is
changed, and the former two appear to follow the scheme discoveryport =
port and controlport = port + 1.
diffs (58 lines):
diff --git a/tools/merovingian/daemon/argvcmds.c
b/tools/merovingian/daemon/argvcmds.c
--- a/tools/merovingian/daemon/argvcmds.c
+++ b/tools/merovingian/daemon/argvcmds.c
@@ -277,6 +277,30 @@
fprintf(stderr, "set: no such property: %s\n", property);
return(1);
}
+ /* special trick to make it easy to use a different port with one
+ * command */
+ if (strcmp(property, "port") == 0) {
+ int oport = kv->ival;
+ char *e;
+ if ((e = setConfVal(kv, p)) != NULL) {
+ fprintf(stderr, "set: failed to set property port:
%s\n", e);
+ free(e);
+ return(1);
+ }
+ kv = findConfKey(ckv, "discoveryport");
+ if (kv != NULL && kv->ival == oport && (e = setConfVal(kv, p))
!= NULL) {
+ fprintf(stderr, "set: failed to set property
discoveryport: %s\n", e);
+ free(e);
+ return(1);
+ }
+ kv = findConfKey(ckv, "controlport");
+ if (kv != NULL && kv->ival == oport + 1) {
+ oport = atoi(p);
+ p = alloca(8);
+ snprintf(p, 8, "%d", oport + 1);
+ property = "controlport";
+ }
+ }
if ((p = setConfVal(kv, p)) != NULL) {
fprintf(stderr, "set: failed to set property %s: %s\n",
property, p);
free(p);
diff --git a/tools/merovingian/daemon/monetdbd.1.in
b/tools/merovingian/daemon/monetdbd.1.in
--- a/tools/merovingian/daemon/monetdbd.1.in
+++ b/tools/merovingian/daemon/monetdbd.1.in
@@ -1,7 +1,7 @@
.\" Process this file with
.\" groff -man -Tascii foo.1
.\"
-.TH MONETDBD 1 "FEB 2011" MonetDB "MonetDB 5"
+.TH MONETDBD 1 "APR 2011" MonetDB "MonetDB 5"
.SH NAME
monetdbd \- the MonetDB Database Server daemon
.SH SYNOPSIS
@@ -153,7 +153,10 @@
This property specifies which TCP port
.B monetdbd
should listen to for regular database connection requests. Defaults to
-50000.
+50000. When this value is changed, discoveryport and controlport are
+changed also, when their values are port and port + 1 for discoveryport
+and controlport respectively. This allows to easily make monetdbd run
+on another port with a single command.
.IP controlport
For remote management of
.BR monetdbd,
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list