Changeset: dcb52c3242cc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dcb52c3242cc
Modified Files:
        NT/monetdb_config.h.in
        common/options/monet_options.c
        configure.ag
        monetdb5/modules/mal/clients.c
        monetdb5/tools/Tests/mserver5--help.stable.err
        monetdb5/tools/Tests/mserver5--help.stable.err.Windows
        testing/Mtest.py.in
        tools/merovingian/daemon/forkmserver.c
        tools/mserver/mserver5.c
Branch: default
Log Message:

Cleanup: remove configure --enable-console, mserver --daemon flags.


diffs (truncated from 302 to 300 lines):

diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -136,9 +136,6 @@
 /* Define if you have the CommonCrypto library */
 /* #undef HAVE_COMMONCRYPTO */
 
-/* If the console should be used */
-#define HAVE_CONSOLE 1
-
 /* Define to 1 if you have the `ctime_r' function. */
 #define HAVE_CTIME_R 1
 
diff --git a/common/options/monet_options.c b/common/options/monet_options.c
--- a/common/options/monet_options.c
+++ b/common/options/monet_options.c
@@ -219,7 +219,7 @@ mo_builtin_settings(opt **Set)
        if (Set == NULL)
                return 0;
 
-#define N_OPTIONS      9       /*MUST MATCH # OPTIONS BELOW */
+#define N_OPTIONS      8       /*MUST MATCH # OPTIONS BELOW */
        set = malloc(sizeof(opt) * N_OPTIONS);
        if (set == NULL)
                return 0;
@@ -234,10 +234,6 @@ mo_builtin_settings(opt **Set)
        set[i].value = strdup(">");
        i++;
        set[i].kind = opt_builtin;
-       set[i].name = strdup("monet_daemon");
-       set[i].value = strdup("no");
-       i++;
-       set[i].kind = opt_builtin;
        set[i].name = strdup("mapi_port");
        set[i].value = strdup("50000");
        i++;
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -300,21 +300,6 @@ AC_ARG_ENABLE(py3integration,
        enable_py3integration=$enableval,
        enable_py3integration=$dft_py3integration)
 
-# The console is a direct client hooked onto the kernel with full
-# administrative privileges, bypassing any security checks.  It is
-# handy only during development.
-# We simply can't disable it for now because Testing gets hopelessly
-# upset about it, but we can offer to the user to disable it for
-# increased security.
-dft_console=yes
-AC_ARG_ENABLE([console],
-       [AS_HELP_STRING([--enable-console],
-               [enables direct console on the server (involves security risks) 
(default=yes)])],
-       [enable_console="$enableval"],
-       [enable_console=$dft_console])
-AS_VAR_IF([enable_console], [no], [],
-       [AC_DEFINE([HAVE_CONSOLE], 1, [If the console should be used])])
-
 dft_int128=auto
 AC_ARG_ENABLE([int128],
        [AS_HELP_STRING([--enable-int128],
@@ -2954,7 +2939,6 @@ for comp in \
        'monetdb5      ' \
        'sql           ' \
        'geom          ' \
-       'console       ' \
        'py2integration' \
        'py3integration' \
        'rintegration  ' \
diff --git a/monetdb5/modules/mal/clients.c b/monetdb5/modules/mal/clients.c
--- a/monetdb5/modules/mal/clients.c
+++ b/monetdb5/modules/mal/clients.c
@@ -651,39 +651,40 @@ CLTsessions(Client cntxt, MalBlkPtr mb, 
                if ( active) BBPunfix(active->batCacheid);
                throw(SQL,"sql.sessions", SQLSTATE(HY001) MAL_MALLOC_FAIL);
        }
-       
+
     MT_lock_set(&mal_contextLock);
-       
-    for (c = mal_clients + (GDKgetenv_isyes("monet_daemon") != 0); c < 
mal_clients + MAL_MAXCLIENTS; c++) 
-       if (c->mode == RUNCLIENT) {
-               if (BUNappend(user, c->username, false) != GDK_SUCCEED)
-                       goto bailout;
-               msg = MTIMEunix_epoch(&ts);
-               if (msg)
-                       goto bailout;
-               clk = c->login * 1000;
-               msg = MTIMEtimestamp_add(&ret,&ts, &clk);
-               if (msg)
-                       goto bailout;
-               if (BUNappend(login, &ret, false) != GDK_SUCCEED)
-                       goto bailout;
-               timeout = c->stimeout / 1000000;
-               if (BUNappend(stimeout, &timeout, false) != GDK_SUCCEED)
-                       goto bailout;
-               msg = MTIMEunix_epoch(&ts);
-               if (msg)
-                       goto bailout;
-               clk = c->lastcmd * 1000;
-               msg = MTIMEtimestamp_add(&ret,&ts, &clk);
-               if (msg)
-                       goto bailout;
-               if (BUNappend(last, &ret, false) != GDK_SUCCEED)
-                       goto bailout;
-               timeout = c->qtimeout / 1000000;
-               if (BUNappend(qtimeout, &timeout, false) != GDK_SUCCEED ||
-                       BUNappend(active, &c->active, false) != GDK_SUCCEED)
-                       goto bailout;
-    }
+
+    for (c = mal_clients + 1; c < mal_clients + MAL_MAXCLIENTS; c++) {
+               if (c->mode == RUNCLIENT) {
+                       if (BUNappend(user, c->username, false) != GDK_SUCCEED)
+                               goto bailout;
+                       msg = MTIMEunix_epoch(&ts);
+                       if (msg)
+                               goto bailout;
+                       clk = c->login * 1000;
+                       msg = MTIMEtimestamp_add(&ret,&ts, &clk);
+                       if (msg)
+                               goto bailout;
+                       if (BUNappend(login, &ret, false) != GDK_SUCCEED)
+                               goto bailout;
+                       timeout = c->stimeout / 1000000;
+                       if (BUNappend(stimeout, &timeout, false) != GDK_SUCCEED)
+                               goto bailout;
+                       msg = MTIMEunix_epoch(&ts);
+                       if (msg)
+                               goto bailout;
+                       clk = c->lastcmd * 1000;
+                       msg = MTIMEtimestamp_add(&ret,&ts, &clk);
+                       if (msg)
+                               goto bailout;
+                       if (BUNappend(last, &ret, false) != GDK_SUCCEED)
+                               goto bailout;
+                       timeout = c->qtimeout / 1000000;
+                       if (BUNappend(qtimeout, &timeout, false) != GDK_SUCCEED 
||
+                               BUNappend(active, &c->active, false) != 
GDK_SUCCEED)
+                               goto bailout;
+               }
+       }
     MT_lock_unset(&mal_contextLock);
        BBPkeepref(*userId = user->batCacheid);
        BBPkeepref(*loginId = login->batCacheid);
diff --git a/monetdb5/tools/Tests/mserver5--help.stable.err 
b/monetdb5/tools/Tests/mserver5--help.stable.err
--- a/monetdb5/tools/Tests/mserver5--help.stable.err
+++ b/monetdb5/tools/Tests/mserver5--help.stable.err
@@ -14,7 +14,6 @@ Usage: mserver5 [options] [scripts]
     --dbpath=<directory>      Specify database location
     --dbextra=<directory>     Directory for transient BATs
     --config=<config_file>    Use config_file to read options from
-    --daemon=yes|no           Do not read commands from standard input [no]
     --single-user             Allow only one user at a time
     --readonly                Safeguard database
     --set <option>=<value>    Set configuration option
@@ -32,7 +31,6 @@ The debug, testing & trace options:
      --algorithms
      --performance
      --optimizers
-     --trace
      --forcemito
      --debug=<bitmask>
 
diff --git a/monetdb5/tools/Tests/mserver5--help.stable.err.Windows 
b/monetdb5/tools/Tests/mserver5--help.stable.err.Windows
--- a/monetdb5/tools/Tests/mserver5--help.stable.err.Windows
+++ b/monetdb5/tools/Tests/mserver5--help.stable.err.Windows
@@ -9,7 +9,6 @@ Usage: mserver5.exe [options] [scripts]
     --dbpath=<directory>      Specify database location
     --dbextra=<directory>     Directory for transient BATs
     --config=<config_file>    Use config_file to read options from
-    --daemon=yes|no           Do not read commands from standard input [no]
     --single-user             Allow only one user at a time
     --readonly                Safeguard database
     --set <option>=<value>    Set configuration option
@@ -27,7 +26,6 @@ The debug, testing & trace options:
      --algorithms
      --performance
      --optimizers
-     --trace
      --forcemito
      --debug=<bitmask>
 
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1718,7 +1718,6 @@ def GetBitsAndModsAndThreads(env) :
     except OSError:
         pass
     cmd.append('--dbpath=%s' % dbpath)
-    cmd.extend(['--set', 'monet_daemon=yes'])
     if env.get('MULTIFARM'):
         cmd.append('--dbextra=%s' % os.path.join(env['GDK_DBFARM'], TSTPREF + 
'_transient'))
         shutil.rmtree(os.path.join(env['GDK_DBFARM'], TSTPREF + '_transient'),
@@ -3038,7 +3037,6 @@ def DoIt(env, SERVER, CALL, TST, EXT, PR
                 shutil.rmtree(os.path.join(env['GDK_DBFARM'], TSTDB + 
'_transient'),
                               ignore_errors = True)
                 os.makedirs(os.path.join(env['GDK_DBFARM'], TSTDB + 
'_transient'))
-            Srvr.extend(['--set', 'monet_daemon=yes'])
             if os.path.isfile(TST + '.options5'):
                 Srvr.extend(openutf8(TST + '.options5').read().split())
             lang=""
diff --git a/tools/merovingian/daemon/forkmserver.c 
b/tools/merovingian/daemon/forkmserver.c
--- a/tools/merovingian/daemon/forkmserver.c
+++ b/tools/merovingian/daemon/forkmserver.c
@@ -602,9 +602,6 @@ forkMserver(char *database, sabdb** stat
                list++;
        }
 
-       /* keep this one last for easy copy/paste with gdb */
-       argv[c++] = "--set"; argv[c++] = "monet_daemon=yes";
-
        argv[c++] = NULL;
 
        freeConfFile(ckv);
diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -49,10 +49,6 @@
 #define getcwd _getcwd
 #endif
 
-#ifdef HAVE_CONSOLE
-static bool monet_daemon;
-#endif
-
 /* NEEDED? */
 #if defined(_MSC_VER) && defined(__cplusplus)
 #include <eh.h>
@@ -94,7 +90,6 @@ usage(char *prog, int xit)
        fprintf(stderr, "    --dbpath=<directory>      Specify database 
location\n");
        fprintf(stderr, "    --dbextra=<directory>     Directory for transient 
BATs\n");
        fprintf(stderr, "    --config=<config_file>    Use config_file to read 
options from\n");
-       fprintf(stderr, "    --daemon=yes|no           Do not read commands 
from standard input [no]\n");
        fprintf(stderr, "    --single-user             Allow only one user at a 
time\n");
        fprintf(stderr, "    --readonly                Safeguard database\n");
        fprintf(stderr, "    --set <option>=<value>    Set configuration 
option\n");
@@ -216,14 +211,8 @@ monet_init(opt *set, int setlen)
        if (GDKinit(set, setlen) != GDK_SUCCEED)
                return 0;
 
-#ifdef HAVE_CONSOLE
-       monet_daemon = false;
-       if (GDKgetenv_isyes("monet_daemon")) {
-               monet_daemon = true;
 #ifdef HAVE_SETSID
-               setsid();
-#endif
-       }
+       setsid();
 #endif
        monet_hello();
        return 1;
@@ -241,12 +230,7 @@ static BOOL WINAPI
 winhandler(DWORD type)
 {
        (void) type;
-#ifdef HAVE_CONSOLE
-       if (!monet_daemon)
-               _Exit(-1);
-       else
-#endif
-               interrupted = 1;
+       interrupted = 1;
        return TRUE;
 }
 #else
@@ -254,12 +238,7 @@ static void
 handler(int sig)
 {
        (void) sig;
-#ifdef HAVE_CONSOLE
-       if (!monet_daemon)
-               _Exit(-1);
-       else
-#endif
-               interrupted = 1;
+       interrupted = 1;
 }
 #endif
 
@@ -281,7 +260,6 @@ main(int argc, char **av)
                { "config", required_argument, NULL, 'c' },
                { "dbpath", required_argument, NULL, 0 },
                { "dbextra", required_argument, NULL, 0 },
-               { "daemon", required_argument, NULL, 0 },
                { "debug", optional_argument, NULL, 'd' },
                { "help", no_argument, NULL, '?' },
                { "version", no_argument, NULL, 0 },
@@ -365,12 +343,6 @@ main(int argc, char **av)
                                        dbextra = optarg;
                                break;
                        }
-#ifdef HAVE_CONSOLE
-                       if (strcmp(long_options[option_index].name, "daemon") 
== 0) {
-                               setlen = mo_add_option(&set, setlen, 
opt_cmdline, "monet_daemon", optarg);
-                               break;
-                       }
-#endif
                        if (strcmp(long_options[option_index].name, 
"single-user") == 0) {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to