BAXTER-IT / yurconf

Baxter Configuration Server
http://www.yurconf.org/
0 stars 1 forks source link

Launch script is needed #14

Closed ykryshchuk closed 10 years ago

ykryshchuk commented 10 years ago

As the yurconf server will be distributed aslinux package that depends on other linux packages we need a proper launch script that will start the server.

Previous approach to run executable JAR requires the exact MANIFEST to be prepared during the build time inside main jar. This can be difficult as at compile time we do not know the providers of other deendencies.

Another way is to start a main class. But this require the classpath to be secified on java command. The maven can prepare a list of all dependencies needed for yurconf server. Some of those dependencies would be redistributed by yurconf package, other will come from different vendors. But other vendors typically distribute the JARs in well defined directories (on linux it is most likely /usr/share/java or subdir).

Our launch script can build a classpath by projecting the dependencies list provided by maven with a real paths of JARs. The script code shall check for possible locations of jar files to decide what appears in classpath.

This aproach is not relevant for standalone tar.gz distribution as it may use all files in delivered lib directory for classpath.

ykryshchuk commented 10 years ago

As an alternative, we can build a classpath on post-install rpm phase. Building the classpath is not too complex, but still it requires to evaluate some system paths.

Both solutions (launch script and post-install) have their pros and cons.

ykryshchuk commented 10 years ago

Create a wiki page which describes the installation steps and also gives an overview how the classpath is constructed for different installation scenarios: https://github.com/BAXTER-IT/yurconf/wiki/Installing-Yurconf

ykryshchuk commented 10 years ago

The way how the classpath reconstructor should work must be inspired by the installation style, like where the libraries would be installed on the target and what is bundled by application and what comes as an external dependency.

During the investigation I followed the recommendations described in following articles:

The launch script has an input list of application dependencies. The script tries to locate the JAR files that corresponds to those dependencies and builds a classpath.

The files are first located in the same directory as main jar file, then in standard location /usr/share/java

ykryshchuk commented 10 years ago

Current script implementation works fine. It is not yet optimal. The relativized paths are sometimes longer than the corresponding absolute paths.

Another option to reuse in script is a build-classpath tool, which may resolve the isntalled java artifacts (including their dependencies) - http://linux.die.net/man/1/build-classpath

For now we can consider the classpath reconstructor as done.