Server restart via command no longer requires running as a daemon , uses execv()...
[citadel.git] / citadel / modules / ctdlproto / serv_syscmds.c
index daf5c9f388d7897ad71328a0c7471810af0ab852..7341ad238c0e6dc82225b18f56358b3a7fa26f60 100644 (file)
@@ -2,7 +2,7 @@
 /* 
  * Main source module for the Citadel server
  *
- * Copyright (c) 1987-2011 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.
  * GNU General Public License for more details.
  */
 
-#include "sysdep.h"
-#include <stdlib.h>
-#include <unistd.h>
 #include <stdio.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
-#if HAVE_BACKTRACE
-#include <execinfo.h>
-#endif
-
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-#include <netdb.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <libcitadel.h>
-#include "citadel.h"
-#include "server.h"
-#include "sysdep_decls.h"
-#include "threads.h"
-#include "citserver.h"
-#include "config.h"
-#include "database.h"
-#include "housekeeping.h"
-#include "user_ops.h"
-#include "msgbase.h"
-#include "support.h"
-#include "locate_host.h"
-#include "room_ops.h"
-#include "control.h"
-#include "euidindex.h"
-#include "context.h"
-#include "svn_revision.h"
-#include "ctdl_module.h"
 
+#include "serv_extensions.h"
+#include "ctdl_module.h"
 
 
 /*
@@ -127,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;
        }