$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
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
<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
/* 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",
+/*
+ * 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
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) {
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");
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)
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",