Dashboard > ApacheDS Addons > ... > Developer's Guide > Server Installer Plugin
Server Installer Plugin
Added by Alex Karasulu, last edited by Alex Karasulu on Jan 26, 2006  (view change)
Labels: 
(None)


Goal

Build a Maven 2 plugin that generates installers for servers using commons-daemon. The installer should use a default bootstrapper and a standard installation layout. The installer should be able to generate various kinds of installers for different platforms. It should be able to generate for all platforms from a single platform.

The installer will need to carry the executables for commons-daemon. These will be deposited into installation images based on the target OS the installer is being generated for.

We should be able to generate installers for Inno (Windows Only), Izpack (All Platforms), Deb (Linux Only), RPM (Linux Only), and Pkgadd (Solaris Sparc and Intel Only).

  1. Plugin must build the installation image for each target OS and package it will build.
    • target/installation-images/linux/intel/rpm/...
    • target/installation-images/linux/intel/deb/...
    • target/installation-images/linux/intel/izpack/...
    • target/installation-images/solaris/intel/pkg/...
    • target/installation-images/solaris/sparc/pkg/...
    • target/installation-images/macosx/powerpc/izpack/...
    • target/installation-images/windows/intel/izpack/...
    • target/installation-images/windows/intel/inno/...
  2. Plugin generates installation layout
    • bin
    • bin/bootstrapper.jar
    • bin/${app}
    • bin/${app}
      .init
    • lib
    • lib/ext
    • conf
    • conf/log4j.properties
    • conf/debug-log4j.properties
    • conf/server.xml
    • conf/bootstrapper.properties
    • var
    • var/log
    • var/partitions
    • var/run
    • var/log/${app}-stderr.log
    • var/log/${app}-stdout.log
  3. Plugin generates target packaging info from pom
    • rpm descriptor
    • izpack descriptor
    • deb descriptor
    • inno descriptor
    • pkg descriptor
  4. Plugin invokes appropriate descriptor mojo to build the installer for each platform
    • inno, rpm, izpack, deb, and pkg descriptors needed.

Notes on Startup

Looks like different daemon frameworks have different entry points when starting up a service. Procrun can call any method that takes a String array but defaults to calling main(String[]). On the otherhand jsvc uses init(String[]).

When calls are made to these methods for service startup the semantics are a bit different as well. Procrun's prunsrv for example terminates the JVM immediately after the main thread dies after calling the Bootstrapper's main(String[]). So for prunsrv a loop is needed to keep the process's main thread alive. Usually this loop opens a server socket and waits for some message on a port, like tomcat with its shutdown port.

On the other hand, jsvc does not need this. Jsvc does not terminate the child process after the main thread dies so long as there are running non-daemon threads. There is no need to keep the main thread alive. It behaves exactly as you would expect a command line invocation of an application would using java.

Site running on a free Atlassian Confluence Open Source Project License granted to Safehaus. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators