Removed chdir() from setup.c - this program requires no run directory.
authorArt Cancro <ajc@citadel.org>
Sat, 2 Jan 2021 00:44:08 +0000 (19:44 -0500)
committerArt Cancro <ajc@citadel.org>
Sat, 2 Jan 2021 00:44:08 +0000 (19:44 -0500)
citadel/server_main.c
citadel/utils/setup.c

index 68af7888e9ef221011eb88f6d523d2736d6a6ac6..b978733e7cf5f2a4d847b11cf5d86e1956481ec1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * citserver's main() function lives here.
  * 
- * Copyright (c) 1987-2020 by the citadel.org team
+ * Copyright (c) 1987-2021 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.
@@ -213,7 +213,7 @@ int main(int argc, char **argv)
        syslog(LOG_INFO, " ");
        syslog(LOG_INFO, "*** Citadel server engine ***\n");
        syslog(LOG_INFO, "Version %d (build %s) ***", REV_LEVEL, svn_revision());
-       syslog(LOG_INFO, "Copyright (C) 1987-2020 by the Citadel development team.");
+       syslog(LOG_INFO, "Copyright (C) 1987-2021 by the Citadel development team.");
        syslog(LOG_INFO, " ");
        syslog(LOG_INFO, "This program is open source software: you can redistribute it and/or");
        syslog(LOG_INFO, "modify it under the terms of the GNU General Public License, version 3.");
@@ -359,6 +359,7 @@ int main(int argc, char **argv)
        int exit_code = master_cleanup(exit_signal);
        ctdl_lockfile(0);
        if (restart_server) {
+               syslog(LOG_INFO, "main:    *** CITADEL SERVER IS RESTARTING ***");
                execv(argv[0], argv);
        }
        return(exit_code);
index ae89d142b327f154ce20244d683ce53402319b8e..09ae02b3d0ae0998b19ea70fa6c021f06e3fc9f4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Citadel setup utility
  *
- * Copyright (c) 1987-2019 by the citadel.org team
+ * Copyright (c) 1987-2021 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.
@@ -670,98 +670,6 @@ void edit_value(int curr)
 }
 
 
-#if 0
-/*
- * Strip "db" entries out of /etc/nsswitch.conf
- */
-void fixnss(void) {
-       FILE *fp_read;
-       int fd_write;
-       char buf[256];
-       char buf_nc[256];
-       char question[512];
-       int i;
-       int file_changed = 0;
-       char new_filename[64];
-       int rv;
-
-       fp_read = fopen(NSSCONF, "r");
-       if (fp_read == NULL) {
-               return;
-       }
-
-       strcpy(new_filename, "/tmp/ctdl_fixnss_XXXXXX");
-       fd_write = mkstemp(new_filename);
-       if (fd_write < 0) {
-               fclose(fp_read);
-               return;
-       }
-
-       while (fgets(buf, sizeof buf, fp_read) != NULL) {
-               strcpy(buf_nc, buf);
-               for (i=0; buf_nc[i]; ++i) {
-                       if (buf_nc[i] == '#') {
-                               buf_nc[i] = 0;
-                               break;
-                       }
-               }
-               for (i=0; i<strlen(buf_nc); ++i) {
-                       if (!strncasecmp(&buf_nc[i], "db", 2)) {
-                               if (i > 0) {
-                                       if ((isspace(buf_nc[i+2])) || (buf_nc[i+2]==0)) {
-                                               file_changed = 1;
-                                               strcpy(&buf_nc[i], &buf_nc[i+2]);
-                                               strcpy(&buf[i], &buf[i+2]);
-                                               if (buf[i]==32) {
-                                                       strcpy(&buf_nc[i], &buf_nc[i+1]);
-                                                       strcpy(&buf[i], &buf[i+1]);
-                                               }
-                                       }
-                               }
-                       }
-               }
-               long buflen = strlen(buf);
-               if (write(fd_write, buf, buflen) != buflen) {
-                       fclose(fp_read);
-                       close(fd_write);
-                       unlink(new_filename);
-                       return;
-               }
-       }
-
-       fclose(fp_read);
-       
-       if (!file_changed) {
-               unlink(new_filename);
-               return;
-       }
-
-       snprintf(question, sizeof question,
-                _(
-                        "\n"
-                        "/etc/nsswitch.conf is configured to use the 'db' module for\n"
-                        "one or more services.  This is not necessary on most systems,\n"
-                        "and it is known to crash the Citadel server when delivering\n"
-                        "mail to the Internet.\n"
-                        "\n"
-                        "Do you want this module to be automatically disabled?\n"
-                        "\n"
-                        )
-       );
-
-       if (yesno(question, 1)) {
-               snprintf(buf, sizeof buf, "/bin/mv -f %s %s", new_filename, NSSCONF);
-               rv = system(buf);
-               if (rv != 0) {
-                       fprintf(stderr, "failed to edit %s.\n", NSSCONF);
-               }
-               chmod(NSSCONF, 0644);
-       }
-       unlink(new_filename);
-}
-#endif
-
-
 /*
  * Messages that are no longer in use.
  * We keep them here so we don't lose the translations if we need them later.
@@ -823,12 +731,6 @@ int main(int argc, char *argv[])
 
        enable_home = ( relh | home );
 
-       if (chdir(ctdl_run_dir) != 0) {
-               display_error("%s: [%s]\n", _("The directory you specified does not exist"), ctdl_run_dir);
-               exit(errno);
-       }
-
-
        /*
         * Connect to the running Citadel server.
         */