Index: openacs-4/packages/acs-bootstrap-installer/bootstrap.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/bootstrap.tcl,v diff -u -r1.24 -r1.25 --- openacs-4/packages/acs-bootstrap-installer/bootstrap.tcl 15 Aug 2003 14:49:34 -0000 1.24 +++ openacs-4/packages/acs-bootstrap-installer/bootstrap.tcl 24 Sep 2003 22:22:37 -0000 1.25 @@ -97,9 +97,18 @@ apm_bootstrap_load_libraries -procs acs-tcl if { [info exists database_problem] } { - # Yikes - database problems. Remember what the problem is, and run the - # installer. + # Yikes - database problems. ns_log Error "$proc_name: $database_problem" + + # Check if the admin enabled the site-failure message, display + # it if enabled. + if { [file exists "$root_directory/www/global/site-failure.html"] } { + ns_log Notice "$proc_name: database problem found; enabling www/global/site-failure.html. Rename this html page if you want to run the installer instead." + source "$root_directory/packages/acs-bootstrap-installer/site-failure-message.tcl" + return + } + + # Remember what the problem is, and run the installer. nsv_set acs_properties database_problem $database_problem ns_log Notice "$proc_name: database problem found; Sourcing the installer." source "$root_directory/packages/acs-bootstrap-installer/installer.tcl" Index: openacs-4/packages/acs-bootstrap-installer/site-failure-message.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/site-failure-message.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-bootstrap-installer/site-failure-message.tcl 24 Sep 2003 22:22:37 -0000 1.1 @@ -0,0 +1,14 @@ +# In case there is a database failure, return a static html page. +# It needs to be enabled manually by the admin of the site. The path +# is hardcoded: www/global/site-failure.html + +proc site_failure_handler { conn arg why } { + + ns_returnfile 500 text/html "[acs_root_dir]/www/global/site-failure.html" + return "filter_return" +} + +# Register the handler for all URLs. +ns_register_filter preauth GET * site_failure_handler +ns_register_filter preauth POST * site_failure_handler +ns_register_filter preauth HEAD * site_failure_handler Index: openacs-4/www/global/site-failure.html.disabled =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/global/site-failure.html.disabled,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/www/global/site-failure.html.disabled 24 Sep 2003 22:22:38 -0000 1.1 @@ -0,0 +1,36 @@ + + + +
+ ++ +Please contact admin@example.com if you think +the problem is not known yet. + + + +