Forum OpenACS Development: Re: RFC: automated installer

Collapse
Posted by Tom Jackson on

Janine,

That is a tough problem. One I have been working on for a while. I actually have a tcl based installation script, currently tagged 'app-install', which installs any software that can be installed via a command line.

Tcl is good for a number of reasons, not the least of which is that it _stops_ when it reaches an error. Shell scripts tend to keep chugging along. Currently my script runs through a loop for each application:

  • Query the user to set variables, using a default if available, i.e. install locations, usernames, etc.
  • Run a series of commands. If a command fails, prompt the user for advice: abort, skip, substitute command.
  • Write/append/permission files.

I ran through the entire 5.0 install doc and used the defaults provided for a postgresql install. I found a number of errors in the docs by doing this.

I have to admit it is a bit tedious to setup, but it does work. All the commands which are actually executed are recorded in a log file along with any output from the commands.

I have command scripts for the following:

  • Download/install tcl
  • Download/install daemontools
  • Download/install aolserver
  • Download/install aolserver-modules (including tDOM)
  • Download/install postgresql
  • Download/install init.d script for postgresql
  • Create OpenACS startup scripts -- nsd.tcl, db user, createdb.
  • Download/install OpenACS software.
  • Setup daemontools control directory for service.
  • Initialize cvs repository.

Usually all that is left is to start up the service:

$ ./bin/service-run

Then install OpenACS by filling in the form.

Each application is independent, but they can be chained together and variables set previously default to the already entered values.

The main issue I need to address is to switch over to using sudo. Some commands were executed 'su'. In general it would be nice to use sudo on every command, and allow switching users. Then some configuration of the sudoers file would be required to run the script.

Example script files are at http://zmbh.com/app-install/. The .rhf files are the configuration files. The application is included with the rmadilo package: http://zmbh.com/rmadilo/.