Server restart via command no longer requires running as a daemon , uses execv()...
[citadel.git] / citadel / modules / ctdlproto / serv_syscmds.c
index 9a11deca6c3aa3b0c641952cc6e5d7fe7dc31a21..7341ad238c0e6dc82225b18f56358b3a7fa26f60 100644 (file)
@@ -2,7 +2,7 @@
 /* 
  * Main source module for the Citadel server
  *
- * Copyright (c) 1987-2017 by the citadel.org team
+ * Copyright (c) 1987-2018 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License, version 3.
@@ -79,16 +79,8 @@ void cmd_scdn(char *argbuf)
        if (CtdlAccessCheck(ac_aide)) return;
 
        new_state = extract_int(argbuf, 0);
-       if ((new_state == 2) || (new_state == 3))
-       {
+       if ((new_state == 2) || (new_state == 3)) {
                restart_server = 1;
-               if (!running_as_daemon)
-               {
-                       syslog(LOG_ERR, "The user requested restart, but not running as deamon! Geronimooooooo!\n");
-                       Reply = "%d %d Warning, not running in deamon mode. maybe we will come up again, but don't lean on it.\n";
-                       state = ERROR;
-               }
-
                restart_server = extract_int(argbuf, 0);
                new_state -= 2;
        }
@@ -98,16 +90,6 @@ void cmd_scdn(char *argbuf)
        cprintf(Reply, state, ScheduledShutdown);
 }
 
-/*
- * Manually initiate log file cull.
- */
-void cmd_cull(char *argbuf) {
-       if (CtdlAccessCheck(ac_internal)) return;
-       cdb_cull_logs();
-       cprintf("%d Database log file cull completed.\n", CIT_OK);
-}
-
-
 
 /*****************************************************************************/
 /*                      MODULE INITIALIZATION STUFF                          */
@@ -119,7 +101,6 @@ CTDL_MODULE_INIT(syscmd)
                CtdlRegisterProtoHook(cmd_down, "DOWN", "perform a server shutdown");
                CtdlRegisterProtoHook(cmd_halt, "HALT", "halt the server without exiting the server process");
                CtdlRegisterProtoHook(cmd_scdn, "SCDN", "schedule or cancel a server shutdown");
-               CtdlRegisterProtoHook(cmd_cull, "CULL", "Cull database logs");
        }
         /* return our id for the Log */
        return "syscmd";