Tcl code: /tcl/0-acs-init.tcl and /packages/acs-bootstrap-installer/bootstrap.tcl
This document describes the startup (bootstrapping) process for an AOLserver running OpenACS.
Before OpenACS 3.3, the OpenACS startup process was extremely
simple: after AOLserver performed its internal initialization
(reading the configuration file, loading shared libraries and
module code, etc.) it scanned through the Tcl library directory
/tcl), sourcing each file in sequence.
While this overall structure for initialization is still intact, package management has thrown a wrench into the works - there are a few extra things to do during initialization, most notably:
Examine the OpenACS file tree for files that should not be present in OpenACS (i.e., that were once part of the OpenACS distribution but have since been removed).
/packagesdirectory for new packages.
Initialize enabled packages by sourcing their
This document examines in detail each of the steps involved in AOLserver/OpenACS startup.
nsd is started, it
reads its configuration file and
chroots itself if necessary. It then loads
the configured modules (e.g., Database and network drivers, Tcl
module files). This step is, and has always been, the same for all
NaviServer/AOLservers, regardless of whether they are running
OpenACS (see the NaviServer/AOLserver documentation for more
Next AOLserver sources, in lexicographical order, each file in
/tcl directory. The first
such file is
which doesn't do much directly except to determine the OpenACS
path root (e.g.,
yourservername) by trimming the
final component from the path to the Tcl library directory
0-acs-init.tcl's has an
important function, namely sourcing
which does the following:
Initialize some NSVs used by the core. These NSVs are documented in
/packages/acs-core/apm-procs.tcl- no need to worry about them unless you're an OpenACS core hacker.
Verify that OpenACS is fully installed. If not (e.g. at the first installation) it prompts a form for providing essential information about the installation.
*-procs.tclfiles in the OpenACS core. We source each file matching the
*-procs.tclglob in the
/packages/acs-kerneldirectory, in lexicographical order. These procedure are needed to perform any of the following steps.
Ensure that the database is available by grabbing and releasing a handle. If we can't obtain a handle, we terminate initialization (since OpenACS couldn't possibly start up the server without access to the database).
Register any new packages in the
/packagesdirectory. In each directory inside
/packages, we look for a
.infofile; if we find a package that hasn't yet been registered with the package manager (i.e., it's been copied there manually), we insert information about it into the database. (The first time OpenACS starts up, no packages will have been registered in the database yet, so this step will registers every single package in the
/packagesdirectory.) Note that packages discovered here are initially disabled; they must be manually enabled in the package manager before they can be used.
Ensure that the
acs-kernelpackage is enabled. If the OpenACS core isn't initialized, the server couldn't possibly be operational, so if there's no enabled version of the OpenACS core we simply mark the latest installed one as enabled.
*-procs.tclfiles for enabled packages, activating their APIs.
*-init.tclfiles for enabled packages, giving packages a chance to register filters and procedures, initialize data structures, etc.
Verify that the core has been properly initialized by checking for the existence of an NSV created by the request processor initialization code. If it's not present, the server won't be operational, so we log an error.
At this point,
is done executing. AOLserver proceeds to source the remaining files
/tcl directory (i.e.,
unpackaged libraries) and begins listening for connections.