* Updated setup to allow more batch mode control of it;
authorArt Cancro <ajc@citadel.org>
Fri, 4 Nov 2005 04:02:46 +0000 (04:02 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 4 Nov 2005 04:02:46 +0000 (04:02 +0000)
  see techdoc/package-setup.txt

citadel/ChangeLog
citadel/setup.c
citadel/techdoc/package-setup.txt [new file with mode: 0644]

index 0d48eadd8d4c1a9ac82e8dd88f654aaa2a09c130..f232ac5ee4895885b956200cb883846f09873ff3 100644 (file)
@@ -1,5 +1,9 @@
 $Id$
 
+Thu Nov  3 23:02:01 EST 2005 ajc
+* Updated setup to allow more batch mode control of it;
+  see techdoc/package-setup.txt
+
 Sun Oct 30 23:03:49 EST 2005 ajc
 * When logging to syslog is enabled, SMTP transactions are now logged to
   LOG_MAIL as well as whatever the normal facility is, in a format
index a5c63531a93e4e31f12b171403d8ad25e230386e..d8a634c2869e521195d83b59e0d710d2dadde446 100644 (file)
@@ -524,13 +524,21 @@ void check_inittab_entry(void)
        }
 
        /* Otherwise, prompt the user to create an entry. */
-       snprintf(question, sizeof question,
-               "Do you want this computer configured to start the Citadel\n"
-               "service automatically?  (If you answer yes, an entry in\n"
-               "/etc/inittab pointing to %s will be added.)\n",
-               looking_for);
-       if (yesno(question) == 0)
-               return;
+       if (getenv("CREATE_INITTAB_ENTRY") != NULL) {
+               if (strcasecmp(getenv("CREATE_INITTAB_ENTRY"), "yes")) {
+                       return;
+               }
+       }
+       else {
+               snprintf(question, sizeof question,
+                       "Do you want this computer configured to start the Citadel\n"
+                       "service automatically?  (If you answer yes, an entry in\n"
+                       "/etc/inittab pointing to %s will be added.)\n",
+                       looking_for);
+               if (yesno(question) == 0) {
+                       return;
+               }
+       }
 
        /* Generate a unique entry name for /etc/inittab */
        generate_entry_name(entryname);
@@ -569,13 +577,21 @@ void check_xinetd_entry(void) {
        if (already_citadel) return;    /* Already set up this way. */
 
        /* Otherwise, prompt the user to create an entry. */
-       snprintf(buf, sizeof buf,
-               "Setup can configure the \"xinetd\" service to automatically\n"
-               "connect incoming telnet sessions to Citadel, bypassing the\n"
-               "host system login: prompt.  Would you like to do this?\n"
-       );
-       if (yesno(buf) == 0)
-               return;
+       if (getenv("CREATE_XINETD_ENTRY") != NULL) {
+               if (strcasecmp(getenv("CREATE_XINETD_ENTRY"), "yes")) {
+                       return;
+               }
+       }
+       else {
+               snprintf(buf, sizeof buf,
+                       "Setup can configure the \"xinetd\" service to automatically\n"
+                       "connect incoming telnet sessions to Citadel, bypassing the\n"
+                       "host system login: prompt.  Would you like to do this?\n"
+               );
+               if (yesno(buf) == 0) {
+                       return;
+               }
+       }
 
        fp = fopen(filename, "w");
        fprintf(fp,
@@ -621,19 +637,29 @@ void disable_other_mta(char *mta) {
        fclose(fp);
        if (lines == 0) return;         /* Nothing to do. */
 
+
        /* Offer to replace other MTA with the vastly superior Citadel :)  */
-       snprintf(buf, sizeof buf,
-               "You appear to have the \"%s\" email program\n"
-               "running on your system.  If you want Citadel mail\n"
-               "connected with %s, you will have to manually integrate\n"
-               "them.  It is preferable to disable %s, and use Citadel's\n"
-               "SMTP, POP3, and IMAP services.\n\n"
-               "May we disable %s so that Citadel has access to ports\n"
-               "25, 110, and 143?\n",
-               mta, mta, mta, mta
-       );
-       if (yesno(buf) == 0)
-               return;
+
+       if (getenv("DISABLE_OTHER_MTA")) {
+               if (strcasecmp(getenv("DISABLE_OTHER_MTA"), "yes")) {
+                       return;
+               }
+       }
+       else {
+               snprintf(buf, sizeof buf,
+                       "You appear to have the \"%s\" email program\n"
+                       "running on your system.  If you want Citadel mail\n"
+                       "connected with %s, you will have to manually integrate\n"
+                       "them.  It is preferable to disable %s, and use Citadel's\n"
+                       "SMTP, POP3, and IMAP services.\n\n"
+                       "May we disable %s so that Citadel has access to ports\n"
+                       "25, 110, and 143?\n",
+                       mta, mta, mta, mta
+               );
+               if (yesno(buf) == 0) {
+                       return;
+               }
+       }
 
        sprintf(buf, "for x in /etc/rc*.d/S*%s; do mv $x `echo $x |sed s/S/K/g`; done >/dev/null 2>&1", mta);
        system(buf);
@@ -746,7 +772,7 @@ void strprompt(char *prompt_title, char *prompt_text, char *str)
                                (prompt_window_height - 2),
                                str,
                                74,
-                               &result,
+                               (const char **) &result,
                                NEWT_FLAG_RETURNEXIT)
                );
                newtRunForm(form);
@@ -1118,14 +1144,6 @@ int main(int argc, char *argv[])
                }
        }
 
-       /*
-          if (setuid(config.c_ctdluid) != 0) {
-          important_message("Citadel Setup",
-          "Failed to change the user ID to your Citadel user.");
-          cleanup(errno);
-          }
-        */
-
 /***** begin version update section ***** */
        /* take care of any updating that is necessary */
 
diff --git a/citadel/techdoc/package-setup.txt b/citadel/techdoc/package-setup.txt
new file mode 100644 (file)
index 0000000..7f54888
--- /dev/null
@@ -0,0 +1,30 @@
+
+Package builders: you can set the following environment variables
+before running setup in quiet mode (setup -q) in order to keep it
+quiet but still do setup.
+
+First, please set CITADEL_INSTALLER to "yes"
+
+Then set:
+
+CITADEL                        Directory in which Citadel is installed
+
+SLAPD_BINARY           Location of slapd (optional)
+LDAP_CONFIG            Location of slapd.conf (optional)
+
+SUPPORT                        Location of libraries, etc. (optional)
+                       (i.e. /usr/local/ctdlsupport)
+
+CTDL_DIALOG            Location of the 'dialog' program (optional)
+
+DISABLE_OTHER_MTA      When other MTA's (Postfix, etc.) are found, setup
+                       will offer to disable them in order to keep them
+                       from interfering with Citadel.  Set this variable to
+                       "yes" to always disable the other MTA without asking,
+                       or to "no" to never disable the other MTA.
+
+CREATE_INITTAB_ENTRY   Set to "yes" to automatically create an entry in
+                       /etc/inittab to start the Citadel server, if needed.
+
+CREATE_XINETD_ENTRY    Set to "yes" to automatically configure xinetd to route
+                       telnet connections into a Citadel client, if needed.