Ticket #263 (assigned enhancement)

Opened 8 years ago

Last modified 8 years ago

Create an autoconf-like installation script

Reported by: rjl Owned by: rjl
Priority: normal Milestone: 1.1.0
Component: Perl scripts Version: 1.0.0
Severity: normal Keywords: installation script autoconf
Cc: Ed <maia@…>

Description

With a proper install script, a number of installation parameters (particularly file paths) can be specified on the command line and used not only to copy distribution files to the indicated locations, but also to set some values in their configuration files, saving administrators the need to edit multiple config files later.

At least three installation modes would be required, specified by flags:

--content-filter : amavisd-maia, Perl scripts

--web-server : PHP scripts, Smarty templates

--database-server : SQL schemas

That way, the install script could be used on all three types of servers, or used with all of these flags if everything is to be installed on a single host.

Installation paths for amavisd-maia, the Perl scripts, the PHP scripts, amavis home directory, and so on could also be specified with individual flags, using default values if an item is not explicitly specified.

This same flag-based mechanism could also be used to perform template substitutions in files like amavisd.conf, letting the administrator specify the paths to things like clamd and spamd sockets, Blowfish key files, and various other parameters that would otherwise have to be hand-edited after installation. Similarly, the location of the database.cfg file could be substituted into templates for the various Perl scripts.

In the case of the database server, the install script could perform a connection test and thus determine whether an existing Maia database is in danger of being overwritten, and if no existing database is found, the install script could then create the database from the schema. If certain schema items are to be overridden at install-time (e.g. score threshold defaults, default language/character set, default theme, etc.), command-line flags could be used to do so.

The full GNU autoconf is probably overkill for something like this, but a relatively simple Perl script could do this job. Configuration files would need to be distributed in template form, e.g. amavisd.conf.dist, with macros inserted in them for substitution by the install script, e.g. "%%BLOWFISH_KEY_PATH%%", etc.

Change History

Changed 8 years ago by anonymous

  • cc Ed <maia@…> added

Changed 8 years ago by dizzyweb@…

One thing I also noticed: the Perl scripts all have similar configurable options, which are all the same. Wouldn't it be better to have those options in one single file, which are somehow included/read by the other files?

Changed 8 years ago by rjl

The operative phrase being "somehow" :) There's still the small matter of how the scripts should know where to find that master configuration file to include. Wherever you put that file, you still need to tell each of those scripts where it is.

We already do this, for instance, with the database.cfg file, which centralizes the database connection information so that you don't need to repeat it in every script. Unfortunately the scripts still need to know where to find the database.cfg file, so there's no avoiding the need to configure at least that one item in every script.

The install script proposed in this ticket would do the job of setting those values, of course.

Changed 8 years ago by Arnaud Launay <asl@…>

What about a /etc/maia.conf ? Would seem pretty standard to me...

Changed 8 years ago by rjl

  • patch set to 0
  • milestone set to 1.0.2

Changed 8 years ago by rjl

  • status changed from new to assigned

Changed 7 years ago by dmorton

  • milestone changed from 1.0.2 to 1.1.0
Note: See TracTickets for help on using tickets.