From add4ef573cd5dc8423bda3325de2cbb3d2886569 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 4 Nov 2005 04:02:46 +0000 Subject: [PATCH] * Updated setup to allow more batch mode control of it; see techdoc/package-setup.txt --- citadel/ChangeLog | 4 ++ citadel/setup.c | 88 +++++++++++++++++++------------ citadel/techdoc/package-setup.txt | 30 +++++++++++ 3 files changed, 87 insertions(+), 35 deletions(-) create mode 100644 citadel/techdoc/package-setup.txt diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 0d48eadd8..f232ac5ee 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 diff --git a/citadel/setup.c b/citadel/setup.c index a5c63531a..d8a634c28 100644 --- a/citadel/setup.c +++ b/citadel/setup.c @@ -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 index 000000000..7f54888a5 --- /dev/null +++ b/citadel/techdoc/package-setup.txt @@ -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. -- 2.30.2