You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/10/18 23:26:02 UTC

[sling-launchpad-debian] 06/15: SLING-4517 Add warning if there is no runmode selected. Re-enabled debian package in the contrib pom.xml. Added oak-s3 to the contrib pom.xml

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-launchpad-debian.git

commit 17a2ebe6d36226f08f2b5a6395502adbfe08d6f0
Author: tomekr <to...@unknown>
AuthorDate: Fri Apr 3 09:23:32 2015 +0000

    SLING-4517 Add warning if there is no runmode selected. Re-enabled debian package in the contrib pom.xml. Added oak-s3 to the contrib pom.xml
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1671021 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md                     |  8 +++++++-
 pom.xml                       |  2 +-
 src/root_fs/etc/default/sling |  3 ---
 src/root_fs/etc/init.d/sling  | 20 ++++++++++++++++++--
 4 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md
index 1b334ae..a002268 100644
--- a/README.md
+++ b/README.md
@@ -22,11 +22,17 @@ Supported run modes are:
 Each of these are supported by building crank files using the sling-s3 module to aggregate configuration templates into usable configurations.
 
 * SLING_EXEC=/opt/sling - Location for all binaries & scripts.
-* SLING_CFG=/etc/sling - Tree of config file templates from which final.crantstart files are built. Editing any of these config templates triggers a rebuild of the target/crank* files.
+* SLING_CFG=/etc/sling - Tree of config file templates from which final.crantstart files are built. Editing any of these config templates triggers a rebuild of the target/crank\* files.
 * SLING_DEFAULTS=/etc/default/sling - Defaults file for location & path setup and to override any of the crank settings.
 * SLING_DATA=/var/lib/sling - Local sling data dir.
 * SLING_LOG_DIR=/var/log/sling - Sling log data.
 
+Additional bundles can be loaded in any of the defined runmodes by creating packages containing the crankstart config and dependent jars:
+/etc/sling/crank\*/\*.txt             - crankstart commands required
+/opt/sling/contrib.<package-name>   - additional bundle dependencies
+
+At start time, all /etc/sling/crank*/*.txt files are concatenated as defined by the /etc/sling/Makefile and sling is started with the runmode defined in /etc/default/sling. The init script link all the jars into one repo folder.
+
 TODO:
 * Support clustered configurations.
 
diff --git a/pom.xml b/pom.xml
index 2f0fc74..b7822c6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -133,9 +133,9 @@ under the License.
                             <goal>jdeb</goal>
                         </goals>
                         <configuration>
-                            <classifier>all</classifier>
                             <snapshotExpand>true</snapshotExpand>
                             <snapshotEnv>BUILD_NUMBER</snapshotEnv>
+                            <classifier>all</classifier>
                             <dataSet>
                                 <!-- etc/{default,logrotate.d}/sling - conf files -->
                                 <data>
diff --git a/src/root_fs/etc/default/sling b/src/root_fs/etc/default/sling
index b8de262..bf5262c 100644
--- a/src/root_fs/etc/default/sling
+++ b/src/root_fs/etc/default/sling
@@ -63,9 +63,6 @@ SLING_DATA=/var/lib/sling
 SLING_LOG_DIR=/var/log/sling
 
 START_LOG_FILE=$SLING_LOG_DIR/startup.log
-
-# Define where to load dependencies from
-M2REPO="${SLING_EXEC}/contrib"
 SLING_SCRIPTS=${SLING_EXEC}/scripts
 CRANKSTART_ENV=${SLING_SCRIPTS}/crankstart.sh
 
diff --git a/src/root_fs/etc/init.d/sling b/src/root_fs/etc/init.d/sling
index 77f0c22..77ff556 100644
--- a/src/root_fs/etc/init.d/sling
+++ b/src/root_fs/etc/init.d/sling
@@ -60,13 +60,29 @@ function start () {
 
 	if [ ! "${RUNMODE}" ] ; then
 		log_warning_msg "RUNMODE is not set in ${SLING_DEFAULTS}"
+		exit -1
 	fi
 
 	check_sling_permissions
 
 	# Get MVN_OPTS from crankstart env file.
-	[ -r $CRANKSTART_ENV ] && . $CRANKSTART_ENV
-	CRANKSTART_JAR=${M2REPO}/crankstart.jar
+	if [ -r $CRANKSTART_ENV ] ; then
+		# Other packages can use ${SLING_EXEC}.${artifactId}
+		# for dependencies to avoid name collisions.
+		# All will be aggregated here to provide a fully
+		# populated local repo.
+		M2REPO=${SLING_EXEC}/repo
+		rm -rf ${M2REPO}
+		install -d --owner=sling --group=sling  ${M2REPO}
+		for f in ${SLING_EXEC}/contrib* ; do
+			sudo -u sling -s cp -sRf $f/* ${M2REPO}
+		done
+		. $CRANKSTART_ENV
+	else
+		log_failure_msg "Missing $CRANKSTART_ENV file, cannot read crankstart env settings."
+		exit -1
+	fi
+	CRANKSTART_JAR=${SLING_EXEC}/contrib/crankstart.jar
 
 	# Update crankstart file if needed
 	log_daemon_msg "Starting sling serices"

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.