Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-922

Load modules on startup from an external directory

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • Launchpad Base 2.1.0
    • Launchpad
    • None

    Description

      Need a way to install and start bundles automatically from an external directory (sling home) on startup. The ideas below are from the list.
      ----------
      > I would like to be able to setup sling to start with a bunch of
      > installed bundles when it first is started. It seems like there are a
      > couple way to do this that I have found but neither is ideal:
      > 1) Rebuild sling from source with the extra bundles in the launcher
      > pom (this seems to create a bunch of resources/# folders with bundles
      > in them)
      > 2) Configure all bundles in the sling.properties file (this requires
      > the bundles to be in an accessible obr)
      > http://incubator.apache.org/sling/site/provisioning-and-startup.html
      >
      > I would like to ideally do something in between like so:
      > Get a binary copy of the sling jar
      > Create a folder with sub-folders like /1 /10 /15
      > Put my bundles in the various subfolders
      > Configure sling.properties to point to the folder
      > Start sling and have all bundles in the sub-folders installed and started

      • Aaron Zeckoski
        ===============
        Currently, as you say in (1), the BootstrapInstaller of the Sling
        launchpad looks into its own resources enclosed in the JAR or WAR file
        for bundles to install on startup.

      How about extending this mechanism like this:

      • Copy all bundles from enclosed resources to
        ${sling.home}/startup. This gives something like
        ${sling.home}/startup/0, /1, /10, /15, ...
        Existing files are only replaced if the files
        enclosed in the Sling launchpad jar/war file are
        newer.
      • Scan ${sling.home}/startup for bundles to install
        in the same way as today the enclosed resources
        are scanned directly.

      So you could place your bundles in that structure and get them installed
      at the requested start level (0 being "default bundle start level").

      A nice side effect of this is, that you can quickly see, which bundles
      have been installed at all.

      • Felix
        =================
        I like this, and agree that this should replace the current mechanism.

      How about adding a sling.properties option to completely ignore the
      bundles that come from the Sling jar/war file? Might make it easier to
      have precise control on what's installed.

      -Bertrand
      =================
      Maybe worth it to make this optional or controllable via a property in the sling properties.

      • Aaron Zeckoski

      Attachments

        1. SLING922_fmeschbe.patch
          30 kB
          Felix Meschberger
        2. SLING-922.patch
          45 kB
          Aaron Zeckoski
        3. binary-test-resources.zip
          10 kB
          Aaron Zeckoski

        Issue Links

          Activity

            People

              fmeschbe Felix Meschberger
              azeckoski Aaron Zeckoski
              Votes:
              3 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 72h
                  72h
                  Remaining:
                  Remaining Estimate - 72h
                  72h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified