* setup now knows about lots of other mail programs it can disable (various
authorArt Cancro <ajc@citadel.org>
Tue, 12 Aug 2003 00:39:35 +0000 (00:39 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 12 Aug 2003 00:39:35 +0000 (00:39 +0000)
  flavors of Cyrus and Courier, for example)
* setup now ensures that it really did startup/shutdown the Citadel service,
  and displays an error message when that fails.
* "make install" now instructs the user run "setup"
* Removed an old GDBM reference from the documentation

citadel/ChangeLog
citadel/Makefile.in
citadel/docs/citadel.html
citadel/setup.c

index 8d3f8f8cbadc1f418d35b9aa151d62e9291c4fc4..6c1bd575345f17f23ec9923ec971328cba07b453 100644 (file)
@@ -1,4 +1,12 @@
  $Log$
+ Revision 608.18  2003/08/12 00:39:35  ajc
+ * setup now knows about lots of other mail programs it can disable (various
+   flavors of Cyrus and Courier, for example)
+ * setup now ensures that it really did startup/shutdown the Citadel service,
+   and displays an error message when that fails.
+ * "make install" now instructs the user run "setup"
+ * Removed an old GDBM reference from the documentation
+
  Revision 608.17  2003/08/05 03:06:58  ajc
  * Added a README.txt file because some Joker kept bugging me about it
  * Reloaded the code that extracts embedded URL's to a place where it'll
@@ -4940,3 +4948,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 01dcfed66ff8476e6c683757033df253ecd39c13..87f9289d5db533019a02c52f1d2e77e4c32304ee 100644 (file)
@@ -168,6 +168,8 @@ msgform: msgform.o
 .PHONY: install-data install-doc install-exec clean cleaner distclean
 
 install: install-exec install-data install-doc
+       echo Installation is complete.
+       echo Now go to your Citadel directory and run 'setup'.
 
 install-data:
        @for i in help messages network/spoolin network/spoolout \
index 5af3cbb876c488cc75ec178e85da91f14138537b..899042ff955f4279c8b619a6ab718d3b51884cb8 100644 (file)
@@ -696,9 +696,8 @@ If you wish to place it in a different directory, you can instead do:</p>
 <p>If you've got Berkeley DB installed in a non-standard location, you
 can help the configure script find it by doing something like this:</p>
 <pre>./configure --with-db=/usr/local/BerkeleyDB-4.1<br></pre>
-<p>The configure script prefers Berkeley DB if it is available, but
-will fall
-back to GDBM if it has to.</p>
+<p>Keep in mind that if you're using Berkeley DB from a non-standard location,
+you'll have to make sure that location is available at runtime.</p>
 <p>File permissions are always a bother to work with. You don't want
 Citadel to crash because someone couldn't access a file, but you also
 don't want shell users peeking into the binaries to do things like
index 11dfd1054fd54474c148087dda497e135d213529..44f9c9f355524e7c79dbd09f3f59df3623a37d89 100644 (file)
@@ -541,7 +541,7 @@ void disable_other_mta(char *mta) {
 
        /* Offer to replace other MTA with the vastly superior Citadel :)  */
        snprintf(buf, sizeof buf,
-               "You appear to have the '%s' mail transport agent\n"
+               "You appear to have the '%s' email program\n"
                "running on your system.  Would you like to disable it,\n"
                "allowing Citadel to handle your system's Internet mail\n"
                "instead?\n",
@@ -559,6 +559,49 @@ void disable_other_mta(char *mta) {
 
 
 
+/* 
+ * Check to see if our server really works.  Returns 0 on success.
+ */
+int test_server(void) {
+       char cmd[256];
+       char cookie[256];
+       FILE *fp;
+       char buf[4096];
+       int found_it = 0;
+
+       /* Generate a silly little cookie.  We're going to write it out
+        * to the server and try to get it back.  The cookie does not
+        * have to be secret ... just unique.
+        */
+       sprintf(cookie, "%ld.%d", time(NULL), getpid());
+
+       sprintf(cmd, "%s/sendcommand -h%s ECHO %s 2>&1",
+               setup_directory,
+               setup_directory,
+               cookie);
+
+       fp = popen(cmd, "r");
+       if (fp == NULL) return(errno);
+
+       while (fgets(buf, sizeof buf, fp) != NULL) {
+               if ( (buf[0]=='2')
+                  && (strstr(buf, cookie) != NULL) ) {
+                       ++found_it;
+               }
+       }
+       pclose(fp);
+
+       if (found_it) {
+               return(0);
+       }
+       return(-1);
+}
+
+
+
+
+
+
 void set_str_val(int msgpos, char str[])
 {
 #ifdef HAVE_NEWT
@@ -781,6 +824,15 @@ int main(int argc, char *argv[])
                sleep(1);
        }
 
+       /* Make sure it's stopped. */
+       if (test_server() == 0) {
+               important_message("Citadel/UX Setup",
+                       "The Citadel service is still running.\n"
+                       "Please stop the service manually and run "
+                       "setup again.");
+               cleanup(1);
+       }
+
        /* Now begin. */
        switch (setup_type) {
 
@@ -952,7 +1004,7 @@ NEW_INST:
        mkdir("netconfigs", 0700);
 
        /* Delete files and directories used by older Citadel versions */
-       system("rm -fr ./chatpipes ./expressmsgs ./sessions 2>/dev/null");
+       system("exec /bin/rm -fr ./rooms ./chatpipes ./expressmsgs ./sessions 2>/dev/null");
        unlink("citadel.log");
        unlink("weekly");
 
@@ -965,6 +1017,18 @@ NEW_INST:
        disable_other_mta("sendmail");
        disable_other_mta("postfix");
        disable_other_mta("qmail");
+       disable_other_mta("cyrus");
+       disable_other_mta("cyrmaster");
+       disable_other_mta("saslauthd");
+       disable_other_mta("mta");
+       disable_other_mta("courier-imap");
+       disable_other_mta("courier-imap-ssl");
+       disable_other_mta("courier-authdaemon");
+       disable_other_mta("courier-pop3");
+       disable_other_mta("courier-pop3d");
+       disable_other_mta("courier-pop");
+       disable_other_mta("vmailmgrd");
+       disable_other_mta("imapd");
 #endif
 
        if ((pw = getpwuid(config.c_bbsuid)) == NULL)
@@ -992,8 +1056,16 @@ NEW_INST:
                        if (a == 0) start_the_service();
                        sleep(1);
                }
-               important_message("Setup finished",
-                       "Setup is finished.  You may now log in.");
+               if (test_server() == 0) {
+                       important_message("Setup finished",
+                               "Setup is finished.  You may now log in.");
+               }
+               else {
+                       important_message("Setup finished",
+                               "Setup is finished, but the Citadel service "
+                               "failed to start.\n"
+                               "Go back and check your configuration.");
+               }
        }
        else {
                important_message("Setup finished",