From ded7df9e394148454cdb3f4421015592da1b4495 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 24 Aug 2003 03:31:50 +0000 Subject: [PATCH] * Finished the setup program * Bumped the internal version number to 5.01 --- webcit/ChangeLog | 5 +++++ webcit/README.txt | 11 ++++++++-- webcit/setup.c | 55 ++++++++++++----------------------------------- webcit/webcit.h | 2 +- 4 files changed, 29 insertions(+), 44 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 460e96ef3..51c6dd495 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,8 @@ $Log$ +Revision 500.23 2003/08/24 03:31:50 ajc +* Finished the setup program +* Bumped the internal version number to 5.01 + Revision 500.22 2003/08/22 00:47:27 ajc * setup is now working, but it still needs a way to detect a running WebCit @@ -1574,3 +1578,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/README.txt b/webcit/README.txt index aaf944ae8..f9b164e0a 100644 --- a/webcit/README.txt +++ b/webcit/README.txt @@ -1,5 +1,5 @@ WEBCIT for the Citadel/UX System - version 5.00 + version 5.01 Copyright (C) 1996-2003 by the authors. Portions written by: Art Cancro @@ -53,7 +53,14 @@ can try it out. Point your web browser to WebCit using a URL such as: want it to, you should set it up to be automatically started by the system at boot time. The recommended way to do this is with an entry in /etc/inittab, because init can then automatically restart WebCit if it happens to crash for -any reason. Open /etc/inittab and add an entry something like this: +any reason. + + The included "setup" program is basically just an installation helper that +asks a series of questions and then adds the appropriate line to inittab to +start WebCit. For most installations, this will do just fine. If you have +special circumstances, or if you'd prefer to configure WebCit manually, you +may skip the setup program. Instead, open /etc/inittab and add an entry +something like this: wc:2345:respawn:/usr/local/webcit/webserver diff --git a/webcit/setup.c b/webcit/setup.c index 18938e80a..9706bafce 100644 --- a/webcit/setup.c +++ b/webcit/setup.c @@ -2,6 +2,8 @@ * $Id$ * * WebCit setup utility + * + * (This is basically just an install wizard. It's not required.) * */ @@ -104,11 +106,11 @@ void shutdown_service(void) { strcpy(init_entry, ""); - /* Determine the fully qualified path name of citserver */ - snprintf(looking_for, sizeof looking_for, "%s/citserver ", WEBCITDIR); + /* Determine the fully qualified path name of webserver */ + snprintf(looking_for, sizeof looking_for, "%s/webserver ", WEBCITDIR); /* Pound through /etc/inittab line by line. Set have_entry to 1 if - * an entry is found which we believe starts citserver. + * an entry is found which we believe starts webserver. */ infp = fopen("/etc/inittab", "r"); if (infp == NULL) { @@ -383,13 +385,13 @@ void check_inittab_entry(void) FILE *infp; char buf[SIZ]; char looking_for[SIZ]; - char question[128]; + char question[SIZ]; char entryname[5]; char listenport[128]; char hostname[128]; char portname[128]; - /* Determine the fully qualified path name of citserver */ + /* Determine the fully qualified path name of webserver */ snprintf(looking_for, sizeof looking_for, "%s/webserver ", WEBCITDIR); /* If there's already an entry, then we have nothing left to do. */ @@ -408,7 +410,7 @@ void check_inittab_entry(void) snprintf(question, sizeof question, "On which port do you want WebCit to listen for HTTP " "requests?\n\nYou can use the standard port (80) if you are " - "not running another web server\n(such as Apache), otherwise " + "not running another\nweb server (such as Apache), otherwise " "select another port."); sprintf(listenport, "2000"); set_value(question, listenport); @@ -453,8 +455,9 @@ void check_inittab_entry(void) display_error(strerror(errno)); } else { fprintf(infp, "# Start the WebCit server...\n"); - fprintf(infp, "%s:2345:respawn:%s %s %s\n", - entryname, looking_for, hostname, portname); + fprintf(infp, "%s:2345:respawn:%s -p%s %s %s\n", + entryname, looking_for, + listenport, hostname, portname); fclose(infp); strcpy(init_entry, entryname); } @@ -463,18 +466,6 @@ void check_inittab_entry(void) -/* - * Check to see if our server really works. Returns 0 on success. - */ -int test_server(void) { - - return 0; /* FIXME ... stubbed out */ - -} - - - - /* * Figure out what type of user interface we're going to use */ @@ -532,7 +523,7 @@ int main(int argc, char *argv[]) /* Get started in a valid setup directory. */ strcpy(setup_directory, WEBCITDIR); - set_value("FIXME enter your setup directory, dumbass.", + set_value("In what directory is WebCit installed?", setup_directory); if (chdir(setup_directory) != 0) { important_message("WebCit Setup", @@ -547,16 +538,6 @@ int main(int argc, char *argv[]) sleep(1); } - /* Make sure it's stopped. FIXME put back in - if (test_server() == 0) { - important_message("WebCit Setup", - "The WebCit service is still running.\n" - "Please stop the service manually and run " - "setup again."); - cleanup(1); - } - */ - /* Now begin. */ switch (setup_type) { @@ -576,16 +557,8 @@ int main(int argc, char *argv[]) if (a == 0) start_the_service(); sleep(1); } - 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 WebCit service " - "failed to start.\n" - "Go back and check your configuration."); - } + important_message("Setup finished", + "Setup is finished. You may now log in."); } else { important_message("Setup finished", diff --git a/webcit/webcit.h b/webcit/webcit.h index 1b0a81f59..7ba7b9493 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -28,7 +28,7 @@ #define SERVER "WebCit v5.00" /* who's in da house */ #define DEVELOPER_ID 0 #define CLIENT_ID 4 -#define CLIENT_VERSION 500 /* This version of WebCit */ +#define CLIENT_VERSION 501 /* This version of WebCit */ #define MINIMUM_CIT_VERSION 611 /* min required Citadel vers */ #define DEFAULT_HOST "localhost" /* Default Citadel server */ #define DEFAULT_PORT "504" -- 2.39.2