by Jon Salz
ACS Documentation :
ACS Core Architecture Guide :
- Tcl code: /tcl/0-acs-init.tcl and /packages/acs-core/bootstrap.tcl
This document describes the startup (bootstrapping) process for an AOLserver
The Big Picture
Before ACS 3.3, the ACS 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 (generally
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 ACS file tree for files that should not be present in ACS
(i.e., that were once part of the ACS distribution but have since been removed).
- Scan the
/packages directory for new packages.
- Initialize enabled packages by sourcing their
This document examines in detail each of the steps involved in AOLserver/ACS startup.
The Startup Process
As soon as the
daemon is executed by the
process (or otherwise),
AOLserver reads its configuration file and
s itself if
necessary. It then loads shared libraries indicated in the
file (e.g., the Oracle driver and
sources Tcl module files (generally in
This step is, and has always been, the same for all AOLservers, regardless of
whether they are running ACS.
Next AOLserver sources, in lexicographical order, each file in the
/tcl directory. The first such file is
do much directly except to determine the ACS path root (e.g.,
/web/yourservername) by trimming the final component
from the path to the Tcl library directory (
0-acs-init.tcl's has an important function, namely
/packages/acs-core/bootstrap.tcl, 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 ACS core hacker.
Verify the deletion of obsolete ACS files.
/tcl directory has evolved quite a bit over the months and years,
and a few files have come and gone. The
contains a list of files which must be deleted from the AOLserver
installation, at the risk of causing weird conflicts, e.g., having several security
bootstrap.tcl scans through this list, logging
error messages to the log if any of these files exist.
*-procs.tcl files in the ACS core.
We source each file matching the
*-procs.tcl glob in the
/packages/acs-core directory, 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 ACS couldn't possibly start up the server without access
to the database).
Register any new packages in the
directory. In each directory inside
/packages, we look for a
.info file; 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 ACS starts up,
no packages will have been registered in the database yet, so
this step will registers every single package in the
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-core package is enabled. If the ACS
core isn't initialized, the server couldn't possibly be operational, so
if there's no enabled version of the ACS core we simply mark the latest
installed one as enabled.
*-procs.tcl files for enabled packages, activating their APIs.
*-init.tcl files 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 in the
(i.e., unpackaged libraries) and begins listening for connections.