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:25:56 UTC

[sling-launchpad-debian] branch master created (now 83d720c)

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

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


      at 83d720c  SLING-7167 Adjust READMEs

This branch includes the following new commits:

     new 7f8cedd  SLING-4151 - Sling Launchpad debian/.ubuntu package, contributed by Bruce Edge, thanks!
     new bc070cb  SLING-4151 - use maven-dependency-plugin to get launchpad jar
     new 6a2f2df  SLING-4151 - reformat pom
     new c887f9f  SLING-4517 Update debian packaging to use crankstart.
     new 02f1f36  SLING-4517 Add Jenkins build number as a part of the file name
     new 17a2ebe  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
     new 7f7844f  SLING-4517 Fixed typo in pom.xml
     new 3370bad  SLING-4698 - Set parent.relativePath to empty for all modules
     new a04e9a8  SLING-4863 Use new launchpad rather than crankstart in the Debian packaging
     new f7db98b  SLING-5144: Update local launchpad references to 8 or 9-SNAPSHOT
     new b60ede7  Switch to parent pom 26
     new c5679d1  SLING-4151 Use the stable launchpad 8 release for the debian package
     new 05e53ff  SLING-4151 Added missing license headers
     new 554dc14  launchpad/debian - use a more specific artifactId
     new 83d720c  SLING-7167 Adjust READMEs

The 15 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


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

[sling-launchpad-debian] 09/15: SLING-4863 Use new launchpad rather than crankstart in the Debian packaging

Posted by ro...@apache.org.
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 a04e9a845f263cbc66df6561d3bc13792dfeb282
Author: Tomasz Rekawek <to...@apache.org>
AuthorDate: Mon Jul 20 18:55:55 2015 +0000

    SLING-4863 Use new launchpad rather than crankstart in the Debian packaging
    
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1691995 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md                                     |  25 +----
 pom.xml                                       | 134 ++++----------------------
 src/deb/control/control                       |   2 +-
 src/deb/control/prerm                         |   1 -
 src/root_fs/etc/default/sling                 |  41 ++++----
 src/root_fs/etc/init.d/sling                  |  35 +------
 src/root_fs/etc/logrotate.d/sling             |   4 +-
 src/root_fs/opt/sling/scripts/sling-common.sh |   4 +-
 8 files changed, 57 insertions(+), 189 deletions(-)

diff --git a/README.md b/README.md
index a002268..c5e4014 100644
--- a/README.md
+++ b/README.md
@@ -9,31 +9,16 @@ config and run
 	"service sling start"
 
 Components used are:
-* [Sling crankstart](https://github.com/apache/sling/tree/trunk/contrib/crankstart)
-* [Sling-s3](https://github.com/apache/sling/tree/trunk/contrib/sling-s3)
+* [Sling launchpad](https://github.com/apache/sling/tree/trunk/launchpad/builder)
 
-Supported run modes are:
+For the list of supported run modes see the official [launchpad documentation](https://sling.apache.org/documentation/the-sling-engine/the-sling-launchpad.html).
 
-    crank           - tar files for nodes and data
-    crank-s3        - tar files for nodes, s3 for data
-    crank-mongo     - mongo for nodes and data
-    crank-s3-mongo  - mongo for nodes, s3 for data
-
-Each of these are supported by building crank files using the sling-s3 module to aggregate configuration templates into usable configurations.
+Important locations:
 
 * 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_DEFAULTS=/etc/default/sling - Defaults file for location & path setup and to override any of the crank settings.
+* SLING_DEFAULTS=/etc/default/sling - Defaults file for location & path setup and to override any of the launchpad 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.
-
-
+* Support clustered configurations.
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 60f88a8..6b40b60 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,83 +46,13 @@ under the License.
             jdeb plugin version for debian package
         -->
         <jdeb.version>1.4</jdeb.version>
+        <launchpad.version>8-SNAPSHOT</launchpad.version>
         <slingInstallDir>/opt/sling</slingInstallDir>
         <slingConfigDir>/etc/sling</slingConfigDir>
-        <slingS3Dir>${basedir/../../sling-s3}</slingS3Dir>
     </properties>
     <build>
         <plugins>
             <plugin>
-                <!-- Copy sling-s3 info local workdir -->
-                <artifactId>maven-resources-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>copy-sling-s3</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>${project.build.directory}/${slingConfigDir}</outputDirectory>
-                            <overwrite>true</overwrite>
-                            <resources>
-                                <resource>
-                                    <directory>${slingS3Dir}</directory>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <!-- Use exec plugin to call make sling-s3 targets -->
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>exec-maven-plugin</artifactId>
-                <version>1.2.1</version>
-                <executions>
-                    <execution>
-                        <!-- make all in the Maven compile phase -->
-                        <id>fix-exec-permissions</id>
-                        <phase>process-sources</phase>
-                        <goals>
-                            <goal>exec</goal>
-                        </goals>
-                        <configuration>
-                            <workingDirectory>${project.build.directory}/${slingConfigDir}</workingDirectory>
-                            <executable>chmod</executable>
-                            <arguments>
-                                <argument>-R</argument>
-                                <argument>775</argument>
-                                <argument>scripts</argument>
-                            </arguments>
-                        </configuration>
-                    </execution>
-                    <execution>
-                        <!-- make all in the Maven compile phase -->
-                        <id>build-config</id>
-                        <phase>generate-resources</phase>
-                        <goals>
-                            <goal>exec</goal>
-                        </goals>
-                        <configuration>
-                        	<environmentVariables>
-                            <OUTPUT>
-                              ${project.build.directory}/contrib
-                            </OUTPUT>
-                          </environmentVariables>
-                          <workingDirectory>${project.build.directory}/${slingConfigDir}</workingDirectory>
-                          <executable>make</executable>
-                          <arguments>
-                              <argument>update-bundles</argument>
-                              <argument>install-deps</argument>
-                              <argument>all</argument>
-                          </arguments>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <plugin>
                 <artifactId>jdeb</artifactId>
                 <groupId>org.vafer</groupId>
                 <version>${jdeb.version}</version>
@@ -148,57 +78,25 @@ under the License.
                                         <prefix>/etc</prefix>
                                     </mapper>
                                 </data>
-                                <!-- all other root_fs -->
-                                <data>
-                                    <src>${project.basedir}/src/root_fs/</src>
-                                    <type>directory</type>
-                                    <excludes>**/.svn/,**/etc/default/,**/etc/logrotate.d/</excludes>
-                                    <mapper>
-                                        <filemode>775</filemode>
-                                        <type>perm</type>
-                                        <prefix>/</prefix>
-                                    </mapper>
-                                </data>
-                                <!-- etc/sling/crank-*.d/ conf files -->
-                                <data>
-                                    <src>${project.build.directory}/${slingConfigDir}</src>
-                                    <type>directory</type>
-                                    <conffile>true</conffile>
-                                    <excludes>**/.svn/,**/contrib/,**/scripts/,**/target/</excludes>
-                                    <mapper>
-                                        <type>perm</type>
-                                        <prefix>${slingConfigDir}</prefix>
-                                    </mapper>
-                                </data>
-                                <!-- crank target files, etc - non-conf files, as they are generated -->
+                                <!-- opt/sling - jar files -->
                                 <data>
-                                    <src>${project.build.directory}/${slingConfigDir}</src>
+                                    <src>${project.build.directory}/opt/sling</src>
                                     <type>directory</type>
-                                    <includes>**/target/*</includes>
+                                    <conffile>false</conffile>
                                     <mapper>
-                                        <filemode>775</filemode>
                                         <type>perm</type>
-                                        <prefix>${slingConfigDir}</prefix>
+                                        <prefix>/opt/sling</prefix>
                                     </mapper>
                                 </data>
-                                <!-- sling-s3 scripts & other binaries -->
+                                <!-- all other root_fs -->
                                 <data>
-                                    <src>${project.build.directory}/${slingConfigDir}</src>
+                                    <src>${project.basedir}/src/root_fs/</src>
                                     <type>directory</type>
-                                    <includes>**/contrib/*,**/scripts/*</includes>
+                                    <excludes>**/.svn/,**/etc/default/,**/etc/logrotate.d/</excludes>
                                     <mapper>
                                         <filemode>775</filemode>
                                         <type>perm</type>
-                                        <prefix>${slingInstallDir}</prefix>
-                                    </mapper>
-                                </data>
-                                <!-- dependencies -->
-                                <data>
-                                    <src>${project.build.directory}/contrib</src>
-                                    <type>directory</type>
-                                    <mapper>
-                                        <type>perm</type>
-                                        <prefix>${slingInstallDir}/contrib</prefix>
+                                        <prefix>/</prefix>
                                     </mapper>
                                 </data>
                             </dataSet>
@@ -211,13 +109,21 @@ under the License.
                 <artifactId>maven-dependency-plugin</artifactId>
                 <executions>
                     <execution>
-                        <id>copy-dependencies</id>
+                        <id>copy</id>
                         <goals>
-                            <goal>copy-dependencies</goal>
+                            <goal>copy</goal>
                         </goals>
                         <phase>process-resources</phase>
                         <configuration>
-                            <outputDirectory>${project.build.directory}</outputDirectory>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>org.apache.sling</groupId>
+                                    <artifactId>org.apache.sling.launchpad</artifactId>
+                                    <version>${launchpad.version}</version>
+                                    <destFileName>org.apache.sling.launchpad.jar</destFileName>
+                                </artifactItem>
+                            </artifactItems>
+                            <outputDirectory>${project.build.directory}/opt/sling</outputDirectory>
                             <excludeTransitive>true</excludeTransitive>
                             <overWriteReleases>false</overWriteReleases>
                             <overWriteSnapshots>false</overWriteSnapshots>
diff --git a/src/deb/control/control b/src/deb/control/control
index 058b5ed..70d8b25 100644
--- a/src/deb/control/control
+++ b/src/deb/control/control
@@ -4,6 +4,6 @@ Section: misc
 Priority: optional
 Architecture: all
 Maintainer: Bruce Edge <br...@nextissuemedia.com>
-Depends: oracle-java7-installer, make
+Depends: oracle-java7-installer
 Description: [[description]]
 Distribution: development
diff --git a/src/deb/control/prerm b/src/deb/control/prerm
index e6be54d..4ab85c8 100644
--- a/src/deb/control/prerm
+++ b/src/deb/control/prerm
@@ -33,7 +33,6 @@ if [ remove = "$1" ]; then
     echo Purging sling generated files
     [ "$DEBUG" ] && set -x
     [ "${SLING_EXEC}" ] 		&& [ -d ${SLING_EXEC} ] 	&& rm -rf ${SLING_EXEC}
-    [ -d ${SLING_CFG}/target ] 								&& rm -rf ${SLING_CFG}/target
     [ "${SLING_LOG_DIR}" ] 		&& [ -d ${SLING_LOG_DIR} ]	&& rm -rf ${SLING_LOG_DIR}
     # Purge deletes data as well
     rm -f $0
diff --git a/src/root_fs/etc/default/sling b/src/root_fs/etc/default/sling
index bf5262c..1be3625 100644
--- a/src/root_fs/etc/default/sling
+++ b/src/root_fs/etc/default/sling
@@ -23,7 +23,7 @@ SLING_GROUP=sling
 
 # sling defaults
 # Note, init script uses :
-# $JAVA_ARGS $JAVA_DEBUG_ARGS -jar $SLING_JAR $SLING_DEFAULT_ARGS
+# $JAVA_ARGS $JAVA_DEBUG_ARGS -jar $SLING_JAR $SLING_ARGS
 
 #
 # All configuration items are setup in /etc/sling/*
@@ -40,44 +40,47 @@ SLING_GROUP=sling
 # of storage configurations before running for the first time
 #
 # Runtime startup mode options:
-# 	crank 			- tar files for nodes and data
-# 	crank-s3 		- tar files for nodes, s3 for data
-#	crank-mongo 	- mongo for nodes and data
-#	crank-s3-mongo 	- mongo for nodes, s3 for data
 #
-#	key:
-#	node store - for node properties and tree structure
-#	data store - for binaries
+# - jackrabbit:    configures and starts up an Apache Jackrabbit 2.x
+#                  JCR repository implementation
+# - oak:           configures and starts up an Apache Jackrabbit Oak
+#                  repository implementation with a SegmentNodeStore
+#                  (TarMK) implementation
+# - oak,oak_mongo: configures and starts up an Apache Jackrabbit Oak
+#                  repository implementation with a DocumentNodeStore
+#                  implementation connected to a MongoDB database. The
+#                  default configuration points to a MongoDB instance
+#                  at mongodb://localhost:27017 and a database named
+#                  sling.
 #
-RUNMODE=""
+RUNMODE="oak"
 #
 ##########################################################################
 
 #
-# Base locations - override default settings in crankfiles.
+# Base locations
 #
 SLING_EXEC=/opt/sling
-SLING_CFG=/etc/sling
 SLING_DEFAULTS=/etc/default/sling
 SLING_DATA=/var/lib/sling
 SLING_LOG_DIR=/var/log/sling
 
 START_LOG_FILE=$SLING_LOG_DIR/startup.log
 SLING_SCRIPTS=${SLING_EXEC}/scripts
-CRANKSTART_ENV=${SLING_SCRIPTS}/crankstart.sh
 
 # Bump RAM allowance
 JAVA_ARGS="-Xmx384M "
 
 # Uncomment for debugging:
-JAVA_ARGS+=" -agentlib:jdwp=transport=dt_socket,address=30303,server=y,suspend=n"
+# JAVA_ARGS+=" -agentlib:jdwp=transport=dt_socket,address=30303,server=y,suspend=n"
 
-#
-# crank file overrides
-#
-JAVA_ARGS+=" -Dport=8090"
-JAVA_ARGS+=" -Dsling.home=${SLING_DATA}"
-JAVA_ARGS+=" -Dlog.file=/var/log/sling/sling.log"
+# Sling arguments, description on https://sling.apache.org/documentation/the-sling-engine/the-sling-launchpad.html
+
+SLING_ARGS=" -p 8090"
+SLING_ARGS+=" -c ${SLING_DATA}"
+SLING_ARGS+=" -f /var/log/sling/sling.log"
+SLING_ARGS+=" -Dsling.run.modes=$RUNMODE"
+SLING_ARGS+=" -Dsling.fileinstall.dir=$SLING_DATA/install"
 
 # Allow gogo shell to run in noninteractive env:
 # From: http://apache-felix.18485.x6.nabble.com/Gogo-shell-on-standard-input-output-streams-td4845969.html#a4845970
diff --git a/src/root_fs/etc/init.d/sling b/src/root_fs/etc/init.d/sling
index 77ff556..68c7744 100644
--- a/src/root_fs/etc/init.d/sling
+++ b/src/root_fs/etc/init.d/sling
@@ -40,18 +40,13 @@ fi
 
 PID=/var/run/sling.pid
 DAEMON=$(which java)
+NAME="sling"
 
 function usage () {
 	log_warning_msg "Purpose: Stop/Start sling"
 	log_warning_msg "Usage  : $0 { stop | start | restart }"
 }
 
-function rebuild_config () {
-	log_progress_msg "Rebuild configuration"
-	cd ${SLING_CFG}
-	make -e target/${RUNMODE}.txt
-}
-
 function stop () {
 	killproc -p $PID $DAEMON TERM
 }
@@ -65,28 +60,7 @@ function start () {
 
 	check_sling_permissions
 
-	# Get MVN_OPTS from crankstart env file.
-	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"
-	rebuild_config
+	SLING_JAR=${SLING_EXEC}/org.apache.sling.launchpad.jar
 
 	log_progress_msg "Start sling daemon"
 	if start-stop-daemon --start \
@@ -98,12 +72,13 @@ function start () {
 		--verbose \
 		--no-close \
 		--exec $(which java) \
+		--name "$NAME" \
 		--start \
 		-- \
 		${JAVA_ARGS} \
 		${MVN_OPTS} \
-		-jar ${CRANKSTART_JAR} \
-		${SLING_CFG}/target/${RUNMODE}.txt \
+		-jar ${SLING_JAR} \
+		${SLING_ARGS} \
 		>$START_LOG_FILE 2>&1
 	then
 		sleep 3
diff --git a/src/root_fs/etc/logrotate.d/sling b/src/root_fs/etc/logrotate.d/sling
index 09bbb5e..9149f54 100644
--- a/src/root_fs/etc/logrotate.d/sling
+++ b/src/root_fs/etc/logrotate.d/sling
@@ -1,4 +1,4 @@
-/var/log/sling/startup.log {
+/var/log/sling/*.log {
   rotate
   size 10M
   copytruncate
@@ -6,4 +6,4 @@
   compress
   missingok
   notifempty
-}
+}
\ No newline at end of file
diff --git a/src/root_fs/opt/sling/scripts/sling-common.sh b/src/root_fs/opt/sling/scripts/sling-common.sh
index ff4ccb9..54ebaeb 100644
--- a/src/root_fs/opt/sling/scripts/sling-common.sh
+++ b/src/root_fs/opt/sling/scripts/sling-common.sh
@@ -36,13 +36,13 @@ else
 	exit -1
 fi
 
-# Make sure premissions & directoreis are OK.
+# Make sure premissions & directories are OK.
 # $1 = force sets all permissions
 function check_sling_permissions() {
 
 	chmod +x /etc/init.d/sling
 
-	for d in SLING_DATA SLING_EXEC SLING_CFG SLING_LOG_DIR ; do
+	for d in SLING_DATA SLING_EXEC SLING_LOG_DIR ; do
 		eval n=\$$d
 		if [ ! "${n}" ] ; then
 			log_failure_msg "Missing $d"

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

[sling-launchpad-debian] 07/15: SLING-4517 Fixed typo in pom.xml

Posted by ro...@apache.org.
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 7f7844f088098fb9976aafe66159be6891f3d36b
Author: Tomasz Rekawek <to...@apache.org>
AuthorDate: Wed Apr 22 10:30:19 2015 +0000

    SLING-4517 Fixed typo in pom.xml
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1675318 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/pom.xml b/pom.xml
index b7822c6..4ba360d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -105,18 +105,18 @@ under the License.
                             <goal>exec</goal>
                         </goals>
                         <configuration>
-                        	> <environmentVariables>
-                        	<OUTPUT>
-                        		${project.build.directory}/contrib
-                        	</OUTPUT>
-                        </environmentVariables>
-                        <workingDirectory>${project.build.directory}/${slingConfigDir}</workingDirectory>
-                            <executable>make</executable>
-                            <arguments>
-                                <argument>update-bundles</argument>
-                                <argument>install-deps</argument>
-                                <argument>all</argument>
-                            </arguments>
+                        	<environmentVariables>
+                            <OUTPUT>
+                              ${project.build.directory}/contrib
+                            </OUTPUT>
+                          </environmentVariables>
+                          <workingDirectory>${project.build.directory}/${slingConfigDir}</workingDirectory>
+                          <executable>make</executable>
+                          <arguments>
+                              <argument>update-bundles</argument>
+                              <argument>install-deps</argument>
+                              <argument>all</argument>
+                          </arguments>
                         </configuration>
                     </execution>
                 </executions>

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

[sling-launchpad-debian] 13/15: SLING-4151 Added missing license headers

Posted by ro...@apache.org.
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 05e53ff72bfe116064b0b695b91eb2505518155b
Author: Tomasz Rekawek <to...@apache.org>
AuthorDate: Wed Jan 27 20:53:14 2016 +0000

    SLING-4151 Added missing license headers
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1727191 13f79535-47bb-0310-9956-ffa450edef68
---
 src/deb/control/control                       | 16 +++++++++++
 src/root_fs/etc/logrotate.d/sling             | 19 ++++++++++++-
 src/root_fs/opt/sling/scripts/sling-common.sh | 40 ++++++++++-----------------
 3 files changed, 48 insertions(+), 27 deletions(-)

diff --git a/src/deb/control/control b/src/deb/control/control
index 70d8b25..8348b1f 100644
--- a/src/deb/control/control
+++ b/src/deb/control/control
@@ -1,3 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
 Package: [[artifactId]]
 Version: [[version]]
 Section: misc
diff --git a/src/root_fs/etc/logrotate.d/sling b/src/root_fs/etc/logrotate.d/sling
index 9149f54..8a6d92a 100644
--- a/src/root_fs/etc/logrotate.d/sling
+++ b/src/root_fs/etc/logrotate.d/sling
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 /var/log/sling/*.log {
   rotate
   size 10M
@@ -6,4 +23,4 @@
   compress
   missingok
   notifempty
-}
\ No newline at end of file
+}
diff --git a/src/root_fs/opt/sling/scripts/sling-common.sh b/src/root_fs/opt/sling/scripts/sling-common.sh
index 54ebaeb..0284678 100644
--- a/src/root_fs/opt/sling/scripts/sling-common.sh
+++ b/src/root_fs/opt/sling/scripts/sling-common.sh
@@ -1,31 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
 #
-#Copyright (c) 2002-08 Chris Lawrence
-#All rights reserved.
+#   http://www.apache.org/licenses/LICENSE-2.0
 #
-#Redistribution and use in source and binary forms, with or without
-#modification, are permitted provided that the following conditions
-#are met:
-#1. Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-#3. Neither the name of the author nor the names of other contributors
-#   may be used to endorse or promote products derived from this software
-#   without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-#IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-#ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
-#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-#EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
 
 SLING_DEFAULTS=/etc/default/sling
 [ "$DEBUG" ] && set -x

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

[sling-launchpad-debian] 11/15: Switch to parent pom 26

Posted by ro...@apache.org.
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 b60ede7afc9996305b5db0fd0b77157442ec33bc
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Jan 3 14:07:46 2016 +0000

    Switch to parent pom 26
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1722720 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index e94da01..535bfa1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>22</version>
+        <version>26</version>
         <relativePath/>
     </parent>
     <artifactId>sling-server</artifactId>

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

[sling-launchpad-debian] 04/15: SLING-4517 Update debian packaging to use crankstart.

Posted by ro...@apache.org.
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 c887f9fbd8b218742987a7e19521b5b3c8d5ef97
Author: tomekr <to...@unknown>
AuthorDate: Thu Mar 26 07:21:30 2015 +0000

    SLING-4517 Update debian packaging to use crankstart.
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1669279 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md                                     |  33 ++++++
 README.txt                                    |  11 --
 pom.xml                                       | 150 ++++++++++++++++++++++----
 src/deb/control/control                       |   2 +-
 src/deb/control/postinst                      |  40 +++----
 src/deb/control/{prerm => postrm}             |  14 +--
 src/deb/control/prerm                         |  18 +++-
 src/root_fs/etc/default/sling                 |  89 +++++++++++++++
 src/root_fs/etc/default/sling.sample          |  58 ----------
 src/root_fs/etc/init.d/sling                  | 145 +++++++++++++------------
 src/root_fs/etc/logrotate.d/sling             |   6 +-
 src/root_fs/opt/sling/scripts/sling-common.sh |  62 +++++++++++
 12 files changed, 431 insertions(+), 197 deletions(-)

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..1b334ae
--- /dev/null
+++ b/README.md
@@ -0,0 +1,33 @@
+Apache Sling debian/ubuntu packaging
+====================================
+
+This is a work in progress .deb packaging for Sling.
+It provides basic init.d start/stop logrotate & sample sling config. The goal is to provide a generic yet configurable sling package to eliminate the need to build sling for in-house deployments.
+
+To run this, and install using dpkg/apt commands, review /etc/default.sling
+config and run
+	"service sling start"
+
+Components used are:
+* [Sling crankstart](https://github.com/apache/sling/tree/trunk/contrib/crankstart)
+* [Sling-s3](https://github.com/apache/sling/tree/trunk/contrib/sling-s3)
+
+Supported run modes are:
+
+    crank           - tar files for nodes and data
+    crank-s3        - tar files for nodes, s3 for data
+    crank-mongo     - mongo for nodes and data
+    crank-s3-mongo  - mongo for nodes, s3 for data
+
+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_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.
+
+TODO:
+* Support clustered configurations.
+
+
diff --git a/README.txt b/README.txt
deleted file mode 100644
index 80233e4..0000000
--- a/README.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Apache Sling debian/ubuntu packageing
-==========================================
-
-This is a work in progress .deb packaging for Sling.
-
-It provides basic init.d start/stop logrotate & sample sling config.
-
-To run this, and install using dpkg/apt commands, review /etc/default.sling
-config and run
-	"service sling start"
-
diff --git a/pom.xml b/pom.xml
index 21207cf..aae864a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,9 +17,9 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
     -->
-<project 
-    xmlns="http://maven.apache.org/POM/4.0.0" 
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+<project
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
@@ -28,7 +28,7 @@ under the License.
         <version>22</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
-    <artifactId>sling-lauchpad</artifactId>
+    <artifactId>sling-server</artifactId>
     <packaging>jar</packaging>
     <version>8-SNAPSHOT</version>
     <name>Apache Sling Launchpad Debian Package Builder</name>
@@ -45,14 +45,87 @@ under the License.
         <!--
             jdeb plugin version for debian package
         -->
-        <jdeb.version>1.0.1</jdeb.version>
+        <jdeb.version>1.4</jdeb.version>
         <launchpad.artifact>org.apache.sling.launchpad</launchpad.artifact>
         <launchpad.version>8-SNAPSHOT</launchpad.version>
         <launchpad.classifier>standalone</launchpad.classifier>
+        <slingInstallDir>/opt/sling</slingInstallDir>
+        <slingConfigDir>/etc/sling</slingConfigDir>
+        <slingS3Dir>${basedir/../../sling-s3}</slingS3Dir>
     </properties>
     <build>
         <plugins>
             <plugin>
+                <!-- Copy sling-s3 info local workdir -->
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-sling-s3</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/${slingConfigDir}</outputDirectory>
+                            <overwrite>true</overwrite>
+                            <resources>
+                                <resource>
+                                    <directory>${slingS3Dir}</directory>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <!-- Use exec plugin to call make sling-s3 targets -->
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <version>1.2.1</version>
+                <executions>
+                    <execution>
+                        <!-- make all in the Maven compile phase -->
+                        <id>fix-exec-permissions</id>
+                        <phase>process-sources</phase>
+                        <goals>
+                            <goal>exec</goal>
+                        </goals>
+                        <configuration>
+                            <workingDirectory>${project.build.directory}/${slingConfigDir}</workingDirectory>
+                            <executable>chmod</executable>
+                            <arguments>
+                                <argument>-R</argument>
+                                <argument>775</argument>
+                                <argument>scripts</argument>
+                            </arguments>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <!-- make all in the Maven compile phase -->
+                        <id>build-config</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>exec</goal>
+                        </goals>
+                        <configuration>
+                        	> <environmentVariables>
+                        	<OUTPUT>
+                        		${project.build.directory}/contrib
+                        	</OUTPUT>
+                        </environmentVariables>
+                        <workingDirectory>${project.build.directory}/${slingConfigDir}</workingDirectory>
+                            <executable>make</executable>
+                            <arguments>
+                                <argument>update-bundles</argument>
+                                <argument>install-deps</argument>
+                                <argument>all</argument>
+                            </arguments>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
                 <artifactId>jdeb</artifactId>
                 <groupId>org.vafer</groupId>
                 <version>${jdeb.version}</version>
@@ -63,24 +136,72 @@ under the License.
                             <goal>jdeb</goal>
                         </goals>
                         <configuration>
+                            <classifier>all</classifier>
                             <dataSet>
+                                <!-- etc/{default,logrotate.d}/sling - conf files -->
                                 <data>
-                                    <src>${project.build.directory}/${launchpad.artifact}-${project.version}-${launchpad.classifier}.jar</src>
-                                    <type>file</type>
+                                    <src>${project.basedir}/src/root_fs/etc</src>
+                                    <type>directory</type>
+                                    <excludes>**/.svn/,**/init.d/</excludes>
+                                    <conffile>true</conffile>
                                     <mapper>
                                         <type>perm</type>
-                                        <prefix>/opt/sling/${project.parent.artifactId}</prefix>
+                                        <prefix>/etc</prefix>
                                     </mapper>
                                 </data>
+                                <!-- all other root_fs -->
                                 <data>
                                     <src>${project.basedir}/src/root_fs/</src>
                                     <type>directory</type>
-                                    <excludes>**/.svn/</excludes>
+                                    <excludes>**/.svn/,**/etc/default/,**/etc/logrotate.d/</excludes>
                                     <mapper>
+                                        <filemode>775</filemode>
                                         <type>perm</type>
                                         <prefix>/</prefix>
                                     </mapper>
                                 </data>
+                                <!-- etc/sling/crank-*.d/ conf files -->
+                                <data>
+                                    <src>${project.build.directory}/${slingConfigDir}</src>
+                                    <type>directory</type>
+                                    <conffile>true</conffile>
+                                    <excludes>**/.svn/,**/contrib/,**/scripts/,**/target/</excludes>
+                                    <mapper>
+                                        <type>perm</type>
+                                        <prefix>${slingConfigDir}</prefix>
+                                    </mapper>
+                                </data>
+                                <!-- crank target files, etc - non-conf files, as they are generated -->
+                                <data>
+                                    <src>${project.build.directory}/${slingConfigDir}</src>
+                                    <type>directory</type>
+                                    <includes>**/target/*</includes>
+                                    <mapper>
+                                        <filemode>775</filemode>
+                                        <type>perm</type>
+                                        <prefix>${slingConfigDir}</prefix>
+                                    </mapper>
+                                </data>
+                                <!-- sling-s3 scripts & other binaries -->
+                                <data>
+                                    <src>${project.build.directory}/${slingConfigDir}</src>
+                                    <type>directory</type>
+                                    <includes>**/contrib/*,**/scripts/*</includes>
+                                    <mapper>
+                                        <filemode>775</filemode>
+                                        <type>perm</type>
+                                        <prefix>${slingInstallDir}</prefix>
+                                    </mapper>
+                                </data>
+                                <!-- dependencies -->
+                                <data>
+                                    <src>${project.build.directory}/contrib</src>
+                                    <type>directory</type>
+                                    <mapper>
+                                        <type>perm</type>
+                                        <prefix>${slingInstallDir}/contrib</prefix>
+                                    </mapper>
+                                </data>
                             </dataSet>
                         </configuration>
                     </execution>
@@ -98,7 +219,6 @@ under the License.
                         <phase>process-resources</phase>
                         <configuration>
                             <outputDirectory>${project.build.directory}</outputDirectory>
-                            <includeArtifactIds>${launchpad.artifact}</includeArtifactIds>
                             <excludeTransitive>true</excludeTransitive>
                             <overWriteReleases>false</overWriteReleases>
                             <overWriteSnapshots>false</overWriteSnapshots>
@@ -108,14 +228,6 @@ under the License.
             </plugin>
         </plugins>
     </build>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>${launchpad.artifact}</artifactId>
-            <version>${launchpad.version}</version>
-            <classifier>${launchpad.classifier}</classifier>
-        </dependency>
-    </dependencies>
     <reporting>
         <plugins>
             <plugin>
@@ -143,4 +255,4 @@ under the License.
             </snapshots>
         </repository>
     </repositories>
-</project>
\ No newline at end of file
+</project>
diff --git a/src/deb/control/control b/src/deb/control/control
index 70d8b25..058b5ed 100644
--- a/src/deb/control/control
+++ b/src/deb/control/control
@@ -4,6 +4,6 @@ Section: misc
 Priority: optional
 Architecture: all
 Maintainer: Bruce Edge <br...@nextissuemedia.com>
-Depends: oracle-java7-installer
+Depends: oracle-java7-installer, make
 Description: [[description]]
 Distribution: development
diff --git a/src/deb/control/postinst b/src/deb/control/postinst
index effaaa0..5d74d99 100644
--- a/src/deb/control/postinst
+++ b/src/deb/control/postinst
@@ -19,39 +19,31 @@
 echo $0 $*
 [ "$DEBUG" ] && set -x
 
-
-
-SLING_DEFAULTS=/etc/default/sling
-if [ ! -e $SLING_DEFAULTS ] ; then
-	cp $SLING_DEFAULTS.sample $SLING_DEFAULTS
+SLING_COMMON=/opt/sling/scripts/sling-common.sh
+if [ -r $SLING_COMMON ] ; then
+	. $SLING_COMMON
+else
+	log_failure_msg "Missing $SLING_COMMON file, cannot read env settings."
+	exit -1
 fi
-. $SLING_DEFAULTS
 
-chmod +x /etc/init.d/sling
+SLING_USER=${SLING_USER:-sling}
+SLING_GROUP=${SLING_GROUP:-sling}
 
-# Check for sling user
-if ! getent passwd | grep -q sling ; then
-	useradd --home-dir $SLING_HOME --gid adm $SLING_USER
-fi
 
-# Make data dir
-SLING_DATA=/var/lib/sling
-if [ ! -d $SLING_DATA ] ; then
-	echo Create $SLING_DATA
-	mkdir -p $SLING_DATA
-	chown -R $SLING_USER:adm $SLING_DATA
+# Check for sling user and group
+if ! getent group | grep -q $SLING_USER ; then
+	groupadd --system $SLING_GROUP
 fi
-
-# Make log dir
-if [ ! -d $SLING_LOG_DIR ] ; then
-	echo Create $SLING_LOG_DIR
-	mkdir -p $SLING_LOG_DIR
-	chown -R $SLING_USER:adm $SLING_LOG_DIR
+if ! getent passwd | grep -q $SLING_GROUP ; then
+	useradd --home-dir $SLING_EXEC --gid $SLING_GROUP $SLING_USER
 fi
 
+check_sling_permissions force
+
 update-rc.d sling defaults
 
+# Only restart if already running
 if service sling status; then
 	service sling restart
 fi
-
diff --git a/src/deb/control/prerm b/src/deb/control/postrm
similarity index 78%
copy from src/deb/control/prerm
copy to src/deb/control/postrm
index 82b15e1..c1d5548 100644
--- a/src/deb/control/prerm
+++ b/src/deb/control/postrm
@@ -18,15 +18,11 @@
 
 echo $0 $*
 [ "$DEBUG" ] && set -x
-. /etc/default/sling || true
 
 if [ remove = "$1" ]; then
-	if service sling status; then
-    	service sling stop
-    fi
-    rm -f $SLING_DEFAULTS
-    if [ "$SLING_DATA" ] && [ -d $SLING_DATA ] ; then
-    	echo Not Purging $SLING_DATA
-    	# rm -rf $SLING_DATA
-    fi
+	update-rc.d -f sling remove
+
+	# Run cleanup script created by prerm
+	CLEANUP=/tmp/sling-cleanup.sh
+	[ -e ${CLEANUP} ] && sh ${CLEANUP} $@
 fi
diff --git a/src/deb/control/prerm b/src/deb/control/prerm
index 82b15e1..e6be54d 100644
--- a/src/deb/control/prerm
+++ b/src/deb/control/prerm
@@ -25,8 +25,18 @@ if [ remove = "$1" ]; then
     	service sling stop
     fi
     rm -f $SLING_DEFAULTS
-    if [ "$SLING_DATA" ] && [ -d $SLING_DATA ] ; then
-    	echo Not Purging $SLING_DATA
-    	# rm -rf $SLING_DATA
-    fi
+
+    # Generate a cleanup script to purge all generated files
+    # Note: validate all deletions!
+    cat >/tmp/sling-cleanup.sh <<-EOT
+    #!/bin/bash
+    echo Purging sling generated files
+    [ "$DEBUG" ] && set -x
+    [ "${SLING_EXEC}" ] 		&& [ -d ${SLING_EXEC} ] 	&& rm -rf ${SLING_EXEC}
+    [ -d ${SLING_CFG}/target ] 								&& rm -rf ${SLING_CFG}/target
+    [ "${SLING_LOG_DIR}" ] 		&& [ -d ${SLING_LOG_DIR} ]	&& rm -rf ${SLING_LOG_DIR}
+    # Purge deletes data as well
+    rm -f $0
+EOT
+
 fi
diff --git a/src/root_fs/etc/default/sling b/src/root_fs/etc/default/sling
new file mode 100644
index 0000000..b8de262
--- /dev/null
+++ b/src/root_fs/etc/default/sling
@@ -0,0 +1,89 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+set -a
+
+# Identification
+SLING_USER=sling
+SLING_GROUP=sling
+
+# sling defaults
+# Note, init script uses :
+# $JAVA_ARGS $JAVA_DEBUG_ARGS -jar $SLING_JAR $SLING_DEFAULT_ARGS
+
+#
+# All configuration items are setup in /etc/sling/*
+# The files are processed aggregated using /etc/sling/Makefile to generate
+# the configuration specific start modes.
+# The final mode of execution is determined by the RUNMODE setting below.
+#
+
+##########################################################################
+#
+#                       SET RUNMODE HERE
+#
+# This must be set before sling will run as one needs to make the choice
+# of storage configurations before running for the first time
+#
+# Runtime startup mode options:
+# 	crank 			- tar files for nodes and data
+# 	crank-s3 		- tar files for nodes, s3 for data
+#	crank-mongo 	- mongo for nodes and data
+#	crank-s3-mongo 	- mongo for nodes, s3 for data
+#
+#	key:
+#	node store - for node properties and tree structure
+#	data store - for binaries
+#
+RUNMODE=""
+#
+##########################################################################
+
+#
+# Base locations - override default settings in crankfiles.
+#
+SLING_EXEC=/opt/sling
+SLING_CFG=/etc/sling
+SLING_DEFAULTS=/etc/default/sling
+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
+
+# Bump RAM allowance
+JAVA_ARGS="-Xmx384M "
+
+# Uncomment for debugging:
+JAVA_ARGS+=" -agentlib:jdwp=transport=dt_socket,address=30303,server=y,suspend=n"
+
+#
+# crank file overrides
+#
+JAVA_ARGS+=" -Dport=8090"
+JAVA_ARGS+=" -Dsling.home=${SLING_DATA}"
+JAVA_ARGS+=" -Dlog.file=/var/log/sling/sling.log"
+
+# Allow gogo shell to run in noninteractive env:
+# From: http://apache-felix.18485.x6.nabble.com/Gogo-shell-on-standard-input-output-streams-td4845969.html#a4845970
+JAVA_ARGS+=" -Dgosh.args=--nointeractive"
+
+set +a
diff --git a/src/root_fs/etc/default/sling.sample b/src/root_fs/etc/default/sling.sample
deleted file mode 100644
index 2875e28..0000000
--- a/src/root_fs/etc/default/sling.sample
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# sling defaults
-
-set -a
-SLING_DATA=/var/lib/sling
-set +a
-
-# usage: org.apache.sling.launchpad.app.Main [ start | stop | status ] [ -j adr ] [ -l loglevel ] [ -f logfile ] [ -c slinghome ] [ -i launchpadhome ] [ -a address ] [ -p port ] { -Dn=v } [ -h ]
-#     start         listen for control connection (uses -j)
-#     stop          terminate running Apache Sling (uses -j)
-#     status        check whether Apache Sling is running (uses -j)
-#     -j adr        host and port to use for control connection in the format '[host:]port' (default 127.0.0.1:0)
-#     -l loglevel   the initial loglevel (0..4, FATAL, ERROR, WARN, INFO, DEBUG)
-#     -f logfile    the log file, "-" for stdout (default logs/error.log)
-#     -c slinghome  the sling context directory (default sling)
-#     -i launchpadhome  the launchpad directory (default slinghome)
-#     -a address    the interfact to bind to (use 0.0.0.0 for any)
-#     -p port       the port to listen to (default 8080)
-#     -r path       the root servlet context path for the http service (default is /)
-#     -n            don't install the shutdown hook
-#     -Dn=v         sets property n to value v. Make sure to use this option *after* the jar filename. The JVM also has a -D option which has a different meaning
-#     -h            prints this usage message
-
-JAVA_ARGS="-Xmx384M "
-# Uncomment for debugging:
-#JAVA_DEBUG_ARGS="-agentlib:jdwp=transport=dt_socket,address=30303,server=y,suspend=n"
-
-SLING_DEFAULT_ARGS="-c $SLING_DATA -p 8090 -a 0.0.0.0 $DEBUG_ARGS"
-
-
-# Don't change anything below this line unless you want to break something
-# ========================================================================
-
-set -a
-SLING_HOME=/opt/sling
-SLING_LOG_DIR=/var/log/sling
-LOG_FILE=$SLING_LOG_DIR/${NAME}-start.log
-SLING_USER=sling
-SLING_DATA=/var/lib/sling
-SLING_DEFAULTS=/etc/default/sling
-set +a
diff --git a/src/root_fs/etc/init.d/sling b/src/root_fs/etc/init.d/sling
index 7905374..77f0c22 100644
--- a/src/root_fs/etc/init.d/sling
+++ b/src/root_fs/etc/init.d/sling
@@ -16,79 +16,93 @@
 # specific language governing permissions and limitations
 # under the License.
 
-#
-# Usage
-#
-function usage () {
-   echo "Purpose: Stop/Start sling"
-   echo "Usage  : $0 { stop | start }"
-}
-
-NAME=sling
-
-PID=/var/run/${NAME}.pid
-
-[ "$DEBUG" ] && set -x
+### BEGIN INIT INFO
+# Provides:          sling
+# Required-Start:    $remote_fs $syslog $named
+# Required-Stop:     $remote_fs $syslog $named
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start sling at boot time
+# Description:       Enable service provided by sling.
+### END INIT INFO
 
 . /etc/profile
-
+export FANCYTTY=true
+. /lib/lsb/init-functions
 export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
+SLING_COMMON=/opt/sling/scripts/sling-common.sh
+if [ -r $SLING_COMMON ] ; then
+	. $SLING_COMMON
+else
+	log_failure_msg "Missing $SLING_COMMON file, cannot read env settings."
+	exit -1
+fi
 
-SLING_DEFAULTS=/etc/default/sling
-[ -r $SLING_DEFAULTS ] && . $SLING_DEFAULTS
-
-SLING_JAR=$(find $SLING_HOME -name \*-standalone.jar)
+PID=/var/run/sling.pid
+DAEMON=$(which java)
 
-running()
-{
-  local PID=$(cat "$1" 2>/dev/null) || return 1
-  kill -0 "$PID" 2>/dev/null
+function usage () {
+	log_warning_msg "Purpose: Stop/Start sling"
+	log_warning_msg "Usage  : $0 { stop | start | restart }"
 }
 
-status() 
-{
-	if running "$PID"
-	then
-	  echo "OK"
-	else
-	  echo "FAILED"
-	fi
+function rebuild_config () {
+	log_progress_msg "Rebuild configuration"
+	cd ${SLING_CFG}
+	make -e target/${RUNMODE}.txt
 }
 
-#
-# Stop current sling instance
-#
 function stop () {
-	start-stop-daemon --stop --pidfile $PID --chdir $SLING_HOME --startas "./$NAME" --signal TERM
+	killproc -p $PID $DAEMON TERM
 }
 
-#
-# Start batch job scheduler
-#
 function start () {
 
-  if start-stop-daemon --start \
-	  --chdir "$SLING_HOME" \
-	  --chuid $SLING_USER \
-	  --pidfile "$PID" \
-	  --make-pidfile \
-	  --startas $(which java) \
-	  -- \
-	  $JAVA_ARGS $JAVA_DEBUG_ARGS \
-	  -jar $SLING_JAR $SLING_DEFAULT_ARGS \
-	  >>$LOG_FILE 2>&1 &
-  then
-	sleep 3s
-	status
-  fi
+	if [ ! "${RUNMODE}" ] ; then
+		log_warning_msg "RUNMODE is not set in ${SLING_DEFAULTS}"
+	fi
+
+	check_sling_permissions
+
+	# Get MVN_OPTS from crankstart env file.
+	[ -r $CRANKSTART_ENV ] && . $CRANKSTART_ENV
+	CRANKSTART_JAR=${M2REPO}/crankstart.jar
+
+	# Update crankstart file if needed
+	log_daemon_msg "Starting sling serices"
+	rebuild_config
+
+	log_progress_msg "Start sling daemon"
+	if start-stop-daemon --start \
+		--chdir "$SLING_EXEC" \
+		--chuid $SLING_USER \
+		--pidfile "$PID" \
+		--make-pidfile \
+		--background \
+		--verbose \
+		--no-close \
+		--exec $(which java) \
+		--start \
+		-- \
+		${JAVA_ARGS} \
+		${MVN_OPTS} \
+		-jar ${CRANKSTART_JAR} \
+		${SLING_CFG}/target/${RUNMODE}.txt \
+		>$START_LOG_FILE 2>&1
+	then
+		sleep 3
+		status_of_proc -p $PID $DAEMON
+	fi
+	log_end_msg $?
 
 }
 
 if test -z "$1"; then
-   usage
-   exit
+	usage
+	exit
 fi
-case $1 in 
+
+case $1 in
 	start)
 		start
 		;;
@@ -96,24 +110,19 @@ case $1 in
 		stop
 		;;
 	restart)
-		stop
-		while ps --pid $(cat $PID) >/dev/null ; do
-			sleep 1
-		done
+		if [ -f $PID ] ; then
+			stop
+			while pidofproc -p $PID $DAEMON > /dev/null ; do
+				sleep 1
+			done
+		fi
 		start
-		;;
+	;;
 	status)
-		if [ $(status) == "OK" ] ; then
-			exit 0
-		else
-			exit 1
-		fi
+		status_of_proc -p $PID $DAEMON
 		;;
 	*)
 		echo "Unknown parameter: $1"
 		usage
 		;;
-	esac
-
-
-# end_of_file
+esac
diff --git a/src/root_fs/etc/logrotate.d/sling b/src/root_fs/etc/logrotate.d/sling
index cf06eb5..09bbb5e 100644
--- a/src/root_fs/etc/logrotate.d/sling
+++ b/src/root_fs/etc/logrotate.d/sling
@@ -1,6 +1,6 @@
-/var/log/sling/sling-start.log {
-  rotate 5
-  size 4M
+/var/log/sling/startup.log {
+  rotate
+  size 10M
   copytruncate
   daily
   compress
diff --git a/src/root_fs/opt/sling/scripts/sling-common.sh b/src/root_fs/opt/sling/scripts/sling-common.sh
new file mode 100644
index 0000000..ff4ccb9
--- /dev/null
+++ b/src/root_fs/opt/sling/scripts/sling-common.sh
@@ -0,0 +1,62 @@
+#
+#Copyright (c) 2002-08 Chris Lawrence
+#All rights reserved.
+#
+#Redistribution and use in source and binary forms, with or without
+#modification, are permitted provided that the following conditions
+#are met:
+#1. Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+#3. Neither the name of the author nor the names of other contributors
+#   may be used to endorse or promote products derived from this software
+#   without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+#IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
+#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+#EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+SLING_DEFAULTS=/etc/default/sling
+[ "$DEBUG" ] && set -x
+if [ -r $SLING_DEFAULTS ] ; then
+	. $SLING_DEFAULTS
+else
+	echo "Missing $SLING_DEFAULTS file, cannot read env settings." 1>&2
+	exit -1
+fi
+
+# Make sure premissions & directoreis are OK.
+# $1 = force sets all permissions
+function check_sling_permissions() {
+
+	chmod +x /etc/init.d/sling
+
+	for d in SLING_DATA SLING_EXEC SLING_CFG SLING_LOG_DIR ; do
+		eval n=\$$d
+		if [ ! "${n}" ] ; then
+			log_failure_msg "Missing $d"
+			exit -1
+		fi
+		if [ ! -d ${n} ] ; then
+			echo "Fix type of ${n}"
+			rm -rf ${n}
+			install --directory --owner=${SLING_USER} --group=${SLING_GROUP} ${n}
+		else
+			if [ "$(stat -c '%U' ${n})" != "${SLING_USER}" ] || [ "$1" = "force" ]; then
+				[ "$1" == "force" ] || echo "Update ownership of ${n}"
+				chown -R ${SLING_USER}:${SLING_GROUP} ${n}
+			fi
+		fi
+	done
+}

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

[sling-launchpad-debian] 12/15: SLING-4151 Use the stable launchpad 8 release for the debian package

Posted by ro...@apache.org.
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 c5679d175671a7ae7bcf0f623641c15c64d1a57c
Author: Tomasz Rekawek <to...@apache.org>
AuthorDate: Fri Jan 22 09:23:24 2016 +0000

    SLING-4151 Use the stable launchpad 8 release for the debian package
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1726159 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 535bfa1..b5f7c19 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,7 +46,7 @@ under the License.
             jdeb plugin version for debian package
         -->
         <jdeb.version>1.4</jdeb.version>
-        <launchpad.version>9-SNAPSHOT</launchpad.version>
+        <launchpad.version>8</launchpad.version>
         <slingInstallDir>/opt/sling</slingInstallDir>
         <slingConfigDir>/etc/sling</slingConfigDir>
     </properties>

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

[sling-launchpad-debian] 02/15: SLING-4151 - use maven-dependency-plugin to get launchpad jar

Posted by ro...@apache.org.
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 bc070cb9cb200c3a48327d98b2d44c08758868d2
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Nov 17 07:23:41 2014 +0000

    SLING-4151 - use maven-dependency-plugin to get launchpad jar
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1640075 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 43 +++++++++++++++++++++++++++++++++++--------
 1 file changed, 35 insertions(+), 8 deletions(-)

diff --git a/pom.xml b/pom.xml
index d727947..88e2f7e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,11 +48,10 @@ under the License.
             jdeb plugin version for debian package
         -->
         <jdeb.version>1.0.1</jdeb.version>
-        <!--
-            builder artifact identifier
-        -->
-        <builder.artifact>org.apache.sling.launchpad</builder.artifact>
 
+        <launchpad.artifact>org.apache.sling.launchpad</launchpad.artifact>
+        <launchpad.version>8-SNAPSHOT</launchpad.version>
+        <launchpad.classifier>standalone</launchpad.classifier>
     </properties>
 
     <build>
@@ -70,7 +69,7 @@ under the License.
                         <configuration>
                             <dataSet>
                                 <data>
-                                    <src>../../../launchpad/builder/target/${builder.artifact}-${project.version}-standalone.jar</src>
+                                    <src>${project.build.directory}/${launchpad.artifact}-${project.version}-${launchpad.classifier}.jar</src>
                                     <type>file</type>
                                     <mapper>
                                         <type>perm</type>
@@ -91,9 +90,38 @@ under the License.
                     </execution>
                 </executions>
             </plugin>
-
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>copy-dependencies</id>
+						<goals>
+    						<goal>copy-dependencies</goal>
+						</goals>
+						<phase>process-resources</phase>
+						<configuration>
+							<outputDirectory>${project.build.directory}</outputDirectory>
+							<includeArtifactIds>${launchpad.artifact}</includeArtifactIds>
+							<excludeTransitive>true</excludeTransitive>
+							<overWriteReleases>false</overWriteReleases>
+							<overWriteSnapshots>false</overWriteSnapshots>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
         </plugins>
     </build>
+    
+	<dependencies>
+	    <dependency>
+	        <groupId>org.apache.sling</groupId>
+	        <artifactId>${launchpad.artifact}</artifactId>
+	        <version>${launchpad.version}</version>
+	        <classifier>${launchpad.classifier}</classifier>
+	    </dependency>
+	</dependencies>
+        
     <reporting>
         <plugins>
             <plugin>
@@ -122,5 +150,4 @@ under the License.
             </snapshots>
         </repository>
     </repositories>
-</project>
-
+</project>
\ No newline at end of file

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

[sling-launchpad-debian] 03/15: SLING-4151 - reformat pom

Posted by ro...@apache.org.
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 6a2f2dfd86168e2b24c8153ccdcf9e46ad2a42fb
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Nov 17 07:25:56 2014 +0000

    SLING-4151 - reformat pom
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1640078 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 87 ++++++++++++++++++++++++++++++-----------------------------------
 1 file changed, 40 insertions(+), 47 deletions(-)

diff --git a/pom.xml b/pom.xml
index 88e2f7e..21207cf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-    <!--
+<!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
@@ -17,8 +17,10 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
     -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
+<project 
+    xmlns="http://maven.apache.org/POM/4.0.0" 
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.sling</groupId>
@@ -26,34 +28,28 @@ under the License.
         <version>22</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
-
     <artifactId>sling-lauchpad</artifactId>
     <packaging>jar</packaging>
     <version>8-SNAPSHOT</version>
-
     <name>Apache Sling Launchpad Debian Package Builder</name>
     <description>
         Simple packaged installation for sling launchpad standalone jar
         as a system daemon.
     </description>
-
     <scm>
         <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/launchpad/builder/debian</connection>
         <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/launchpad/builder/debian</developerConnection>
         <url>http://svn.apache.org/viewvc/sling/trunk/launchpad/builder/debian</url>
     </scm>
-
     <properties>
         <!--
             jdeb plugin version for debian package
         -->
         <jdeb.version>1.0.1</jdeb.version>
-
         <launchpad.artifact>org.apache.sling.launchpad</launchpad.artifact>
         <launchpad.version>8-SNAPSHOT</launchpad.version>
         <launchpad.classifier>standalone</launchpad.classifier>
     </properties>
-
     <build>
         <plugins>
             <plugin>
@@ -77,51 +73,49 @@ under the License.
                                     </mapper>
                                 </data>
                                 <data>
-                                        <src>${project.basedir}/src/root_fs/</src>
-                                        <type>directory</type>
-                                        <excludes>**/.svn/</excludes>
-                                        <mapper>
-                                                <type>perm</type>
-                                                <prefix>/</prefix>
-                                        </mapper>
+                                    <src>${project.basedir}/src/root_fs/</src>
+                                    <type>directory</type>
+                                    <excludes>**/.svn/</excludes>
+                                    <mapper>
+                                        <type>perm</type>
+                                        <prefix>/</prefix>
+                                    </mapper>
                                 </data>
                             </dataSet>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-dependency-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>copy-dependencies</id>
-						<goals>
-    						<goal>copy-dependencies</goal>
-						</goals>
-						<phase>process-resources</phase>
-						<configuration>
-							<outputDirectory>${project.build.directory}</outputDirectory>
-							<includeArtifactIds>${launchpad.artifact}</includeArtifactIds>
-							<excludeTransitive>true</excludeTransitive>
-							<overWriteReleases>false</overWriteReleases>
-							<overWriteSnapshots>false</overWriteSnapshots>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-dependencies</id>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <phase>process-resources</phase>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}</outputDirectory>
+                            <includeArtifactIds>${launchpad.artifact}</includeArtifactIds>
+                            <excludeTransitive>true</excludeTransitive>
+                            <overWriteReleases>false</overWriteReleases>
+                            <overWriteSnapshots>false</overWriteSnapshots>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
-    
-	<dependencies>
-	    <dependency>
-	        <groupId>org.apache.sling</groupId>
-	        <artifactId>${launchpad.artifact}</artifactId>
-	        <version>${launchpad.version}</version>
-	        <classifier>${launchpad.classifier}</classifier>
-	    </dependency>
-	</dependencies>
-        
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>${launchpad.artifact}</artifactId>
+            <version>${launchpad.version}</version>
+            <classifier>${launchpad.classifier}</classifier>
+        </dependency>
+    </dependencies>
     <reporting>
         <plugins>
             <plugin>
@@ -136,7 +130,6 @@ under the License.
             </plugin>
         </plugins>
     </reporting>
-
     <repositories>
         <repository>
             <id>OPS4J</id>

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

[sling-launchpad-debian] 05/15: SLING-4517 Add Jenkins build number as a part of the file name

Posted by ro...@apache.org.
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 02f1f36c057bda25a3fafad28705b062837626fd
Author: tomekr <to...@unknown>
AuthorDate: Tue Mar 31 19:58:00 2015 +0000

    SLING-4517 Add Jenkins build number as a part of the file name
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1670458 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index aae864a..2f0fc74 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,9 +46,6 @@ under the License.
             jdeb plugin version for debian package
         -->
         <jdeb.version>1.4</jdeb.version>
-        <launchpad.artifact>org.apache.sling.launchpad</launchpad.artifact>
-        <launchpad.version>8-SNAPSHOT</launchpad.version>
-        <launchpad.classifier>standalone</launchpad.classifier>
         <slingInstallDir>/opt/sling</slingInstallDir>
         <slingConfigDir>/etc/sling</slingConfigDir>
         <slingS3Dir>${basedir/../../sling-s3}</slingS3Dir>
@@ -137,6 +134,8 @@ under the License.
                         </goals>
                         <configuration>
                             <classifier>all</classifier>
+                            <snapshotExpand>true</snapshotExpand>
+                            <snapshotEnv>BUILD_NUMBER</snapshotEnv>
                             <dataSet>
                                 <!-- etc/{default,logrotate.d}/sling - conf files -->
                                 <data>

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

[sling-launchpad-debian] 10/15: SLING-5144: Update local launchpad references to 8 or 9-SNAPSHOT

Posted by ro...@apache.org.
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 f7db98bc009e7dfdfd8462c97749ca7c6893e582
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Oct 16 14:32:23 2015 +0000

    SLING-5144: Update local launchpad references to 8 or 9-SNAPSHOT
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1709016 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6b40b60..e94da01 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
     </parent>
     <artifactId>sling-server</artifactId>
     <packaging>jar</packaging>
-    <version>8-SNAPSHOT</version>
+    <version>9-SNAPSHOT</version>
     <name>Apache Sling Launchpad Debian Package Builder</name>
     <description>
         Simple packaged installation for sling launchpad standalone jar
@@ -46,7 +46,7 @@ under the License.
             jdeb plugin version for debian package
         -->
         <jdeb.version>1.4</jdeb.version>
-        <launchpad.version>8-SNAPSHOT</launchpad.version>
+        <launchpad.version>9-SNAPSHOT</launchpad.version>
         <slingInstallDir>/opt/sling</slingInstallDir>
         <slingConfigDir>/etc/sling</slingConfigDir>
     </properties>

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

[sling-launchpad-debian] 08/15: SLING-4698 - Set parent.relativePath to empty for all modules

Posted by ro...@apache.org.
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 3370badf789f5d9c07ab885cd09f3e7cf6dc1035
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu May 7 10:14:40 2015 +0000

    SLING-4698 - Set parent.relativePath to empty for all modules
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1678154 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 4ba360d..60f88a8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@ under the License.
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
         <version>22</version>
-        <relativePath>../../../parent/pom.xml</relativePath>
+        <relativePath/>
     </parent>
     <artifactId>sling-server</artifactId>
     <packaging>jar</packaging>

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

[sling-launchpad-debian] 01/15: SLING-4151 - Sling Launchpad debian/.ubuntu package, contributed by Bruce Edge, thanks!

Posted by ro...@apache.org.
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 7f8ceddd4c3ae171da92b28f8ceda8bcc0ebc156
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Nov 13 13:00:09 2014 +0000

    SLING-4151 - Sling Launchpad debian/.ubuntu package, contributed by Bruce Edge, thanks!
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1639317 13f79535-47bb-0310-9956-ffa450edef68
---
 README.txt                           |  11 +++
 pom.xml                              | 126 +++++++++++++++++++++++++++++++++++
 src/deb/control/control              |   9 +++
 src/deb/control/postinst             |  57 ++++++++++++++++
 src/deb/control/prerm                |  32 +++++++++
 src/root_fs/etc/default/sling.sample |  58 ++++++++++++++++
 src/root_fs/etc/init.d/sling         | 119 +++++++++++++++++++++++++++++++++
 src/root_fs/etc/logrotate.d/sling    |   9 +++
 8 files changed, 421 insertions(+)

diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..80233e4
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,11 @@
+Apache Sling debian/ubuntu packageing
+==========================================
+
+This is a work in progress .deb packaging for Sling.
+
+It provides basic init.d start/stop logrotate & sample sling config.
+
+To run this, and install using dpkg/apt commands, review /etc/default.sling
+config and run
+	"service sling start"
+
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..d727947
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+    <!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+    -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>22</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>sling-lauchpad</artifactId>
+    <packaging>jar</packaging>
+    <version>8-SNAPSHOT</version>
+
+    <name>Apache Sling Launchpad Debian Package Builder</name>
+    <description>
+        Simple packaged installation for sling launchpad standalone jar
+        as a system daemon.
+    </description>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/launchpad/builder/debian</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/launchpad/builder/debian</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/launchpad/builder/debian</url>
+    </scm>
+
+    <properties>
+        <!--
+            jdeb plugin version for debian package
+        -->
+        <jdeb.version>1.0.1</jdeb.version>
+        <!--
+            builder artifact identifier
+        -->
+        <builder.artifact>org.apache.sling.launchpad</builder.artifact>
+
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>jdeb</artifactId>
+                <groupId>org.vafer</groupId>
+                <version>${jdeb.version}</version>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>jdeb</goal>
+                        </goals>
+                        <configuration>
+                            <dataSet>
+                                <data>
+                                    <src>../../../launchpad/builder/target/${builder.artifact}-${project.version}-standalone.jar</src>
+                                    <type>file</type>
+                                    <mapper>
+                                        <type>perm</type>
+                                        <prefix>/opt/sling/${project.parent.artifactId}</prefix>
+                                    </mapper>
+                                </data>
+                                <data>
+                                        <src>${project.basedir}/src/root_fs/</src>
+                                        <type>directory</type>
+                                        <excludes>**/.svn/</excludes>
+                                        <mapper>
+                                                <type>perm</type>
+                                                <prefix>/</prefix>
+                                        </mapper>
+                                </data>
+                            </dataSet>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+        </plugins>
+    </build>
+    <reporting>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <configuration>
+                    <!-- No javadocs -->
+                    <excludePackageNames>
+                        org.apache.sling
+                    </excludePackageNames>
+                </configuration>
+            </plugin>
+        </plugins>
+    </reporting>
+
+    <repositories>
+        <repository>
+            <id>OPS4J</id>
+            <name>OPS4J Repository</name>
+            <url>http://repository.ops4j.org/maven2</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+    </repositories>
+</project>
+
diff --git a/src/deb/control/control b/src/deb/control/control
new file mode 100644
index 0000000..70d8b25
--- /dev/null
+++ b/src/deb/control/control
@@ -0,0 +1,9 @@
+Package: [[artifactId]]
+Version: [[version]]
+Section: misc
+Priority: optional
+Architecture: all
+Maintainer: Bruce Edge <br...@nextissuemedia.com>
+Depends: oracle-java7-installer
+Description: [[description]]
+Distribution: development
diff --git a/src/deb/control/postinst b/src/deb/control/postinst
new file mode 100644
index 0000000..effaaa0
--- /dev/null
+++ b/src/deb/control/postinst
@@ -0,0 +1,57 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+echo $0 $*
+[ "$DEBUG" ] && set -x
+
+
+
+SLING_DEFAULTS=/etc/default/sling
+if [ ! -e $SLING_DEFAULTS ] ; then
+	cp $SLING_DEFAULTS.sample $SLING_DEFAULTS
+fi
+. $SLING_DEFAULTS
+
+chmod +x /etc/init.d/sling
+
+# Check for sling user
+if ! getent passwd | grep -q sling ; then
+	useradd --home-dir $SLING_HOME --gid adm $SLING_USER
+fi
+
+# Make data dir
+SLING_DATA=/var/lib/sling
+if [ ! -d $SLING_DATA ] ; then
+	echo Create $SLING_DATA
+	mkdir -p $SLING_DATA
+	chown -R $SLING_USER:adm $SLING_DATA
+fi
+
+# Make log dir
+if [ ! -d $SLING_LOG_DIR ] ; then
+	echo Create $SLING_LOG_DIR
+	mkdir -p $SLING_LOG_DIR
+	chown -R $SLING_USER:adm $SLING_LOG_DIR
+fi
+
+update-rc.d sling defaults
+
+if service sling status; then
+	service sling restart
+fi
+
diff --git a/src/deb/control/prerm b/src/deb/control/prerm
new file mode 100644
index 0000000..82b15e1
--- /dev/null
+++ b/src/deb/control/prerm
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+echo $0 $*
+[ "$DEBUG" ] && set -x
+. /etc/default/sling || true
+
+if [ remove = "$1" ]; then
+	if service sling status; then
+    	service sling stop
+    fi
+    rm -f $SLING_DEFAULTS
+    if [ "$SLING_DATA" ] && [ -d $SLING_DATA ] ; then
+    	echo Not Purging $SLING_DATA
+    	# rm -rf $SLING_DATA
+    fi
+fi
diff --git a/src/root_fs/etc/default/sling.sample b/src/root_fs/etc/default/sling.sample
new file mode 100644
index 0000000..2875e28
--- /dev/null
+++ b/src/root_fs/etc/default/sling.sample
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# sling defaults
+
+set -a
+SLING_DATA=/var/lib/sling
+set +a
+
+# usage: org.apache.sling.launchpad.app.Main [ start | stop | status ] [ -j adr ] [ -l loglevel ] [ -f logfile ] [ -c slinghome ] [ -i launchpadhome ] [ -a address ] [ -p port ] { -Dn=v } [ -h ]
+#     start         listen for control connection (uses -j)
+#     stop          terminate running Apache Sling (uses -j)
+#     status        check whether Apache Sling is running (uses -j)
+#     -j adr        host and port to use for control connection in the format '[host:]port' (default 127.0.0.1:0)
+#     -l loglevel   the initial loglevel (0..4, FATAL, ERROR, WARN, INFO, DEBUG)
+#     -f logfile    the log file, "-" for stdout (default logs/error.log)
+#     -c slinghome  the sling context directory (default sling)
+#     -i launchpadhome  the launchpad directory (default slinghome)
+#     -a address    the interfact to bind to (use 0.0.0.0 for any)
+#     -p port       the port to listen to (default 8080)
+#     -r path       the root servlet context path for the http service (default is /)
+#     -n            don't install the shutdown hook
+#     -Dn=v         sets property n to value v. Make sure to use this option *after* the jar filename. The JVM also has a -D option which has a different meaning
+#     -h            prints this usage message
+
+JAVA_ARGS="-Xmx384M "
+# Uncomment for debugging:
+#JAVA_DEBUG_ARGS="-agentlib:jdwp=transport=dt_socket,address=30303,server=y,suspend=n"
+
+SLING_DEFAULT_ARGS="-c $SLING_DATA -p 8090 -a 0.0.0.0 $DEBUG_ARGS"
+
+
+# Don't change anything below this line unless you want to break something
+# ========================================================================
+
+set -a
+SLING_HOME=/opt/sling
+SLING_LOG_DIR=/var/log/sling
+LOG_FILE=$SLING_LOG_DIR/${NAME}-start.log
+SLING_USER=sling
+SLING_DATA=/var/lib/sling
+SLING_DEFAULTS=/etc/default/sling
+set +a
diff --git a/src/root_fs/etc/init.d/sling b/src/root_fs/etc/init.d/sling
new file mode 100644
index 0000000..7905374
--- /dev/null
+++ b/src/root_fs/etc/init.d/sling
@@ -0,0 +1,119 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#
+# Usage
+#
+function usage () {
+   echo "Purpose: Stop/Start sling"
+   echo "Usage  : $0 { stop | start }"
+}
+
+NAME=sling
+
+PID=/var/run/${NAME}.pid
+
+[ "$DEBUG" ] && set -x
+
+. /etc/profile
+
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
+
+SLING_DEFAULTS=/etc/default/sling
+[ -r $SLING_DEFAULTS ] && . $SLING_DEFAULTS
+
+SLING_JAR=$(find $SLING_HOME -name \*-standalone.jar)
+
+running()
+{
+  local PID=$(cat "$1" 2>/dev/null) || return 1
+  kill -0 "$PID" 2>/dev/null
+}
+
+status() 
+{
+	if running "$PID"
+	then
+	  echo "OK"
+	else
+	  echo "FAILED"
+	fi
+}
+
+#
+# Stop current sling instance
+#
+function stop () {
+	start-stop-daemon --stop --pidfile $PID --chdir $SLING_HOME --startas "./$NAME" --signal TERM
+}
+
+#
+# Start batch job scheduler
+#
+function start () {
+
+  if start-stop-daemon --start \
+	  --chdir "$SLING_HOME" \
+	  --chuid $SLING_USER \
+	  --pidfile "$PID" \
+	  --make-pidfile \
+	  --startas $(which java) \
+	  -- \
+	  $JAVA_ARGS $JAVA_DEBUG_ARGS \
+	  -jar $SLING_JAR $SLING_DEFAULT_ARGS \
+	  >>$LOG_FILE 2>&1 &
+  then
+	sleep 3s
+	status
+  fi
+
+}
+
+if test -z "$1"; then
+   usage
+   exit
+fi
+case $1 in 
+	start)
+		start
+		;;
+	stop)
+		stop
+		;;
+	restart)
+		stop
+		while ps --pid $(cat $PID) >/dev/null ; do
+			sleep 1
+		done
+		start
+		;;
+	status)
+		if [ $(status) == "OK" ] ; then
+			exit 0
+		else
+			exit 1
+		fi
+		;;
+	*)
+		echo "Unknown parameter: $1"
+		usage
+		;;
+	esac
+
+
+# end_of_file
diff --git a/src/root_fs/etc/logrotate.d/sling b/src/root_fs/etc/logrotate.d/sling
new file mode 100644
index 0000000..cf06eb5
--- /dev/null
+++ b/src/root_fs/etc/logrotate.d/sling
@@ -0,0 +1,9 @@
+/var/log/sling/sling-start.log {
+  rotate 5
+  size 4M
+  copytruncate
+  daily
+  compress
+  missingok
+  notifempty
+}

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

[sling-launchpad-debian] 14/15: launchpad/debian - use a more specific artifactId

Posted by ro...@apache.org.
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 554dc14512f42d8fe90728bc700e24ee9a23a08a
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Sep 28 18:33:28 2017 +0000

    launchpad/debian - use a more specific artifactId
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1810025 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index b5f7c19..f8661d6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@ under the License.
         <version>26</version>
         <relativePath/>
     </parent>
-    <artifactId>sling-server</artifactId>
+    <artifactId>sling-launchpad-debian</artifactId>
     <packaging>jar</packaging>
     <version>9-SNAPSHOT</version>
     <name>Apache Sling Launchpad Debian Package Builder</name>
@@ -49,6 +49,7 @@ under the License.
         <launchpad.version>8</launchpad.version>
         <slingInstallDir>/opt/sling</slingInstallDir>
         <slingConfigDir>/etc/sling</slingConfigDir>
+        <debArtifactName>sling-server</debArtifactName>
     </properties>
     <build>
         <plugins>
@@ -63,6 +64,8 @@ under the License.
                             <goal>jdeb</goal>
                         </goals>
                         <configuration>
+                            <deb>${project.build.directory}/${debArtifactName}_${version}.deb</deb>
+                            <installDir>/opt/${debArtifactName}</installDir>
                             <snapshotExpand>true</snapshotExpand>
                             <snapshotEnv>BUILD_NUMBER</snapshotEnv>
                             <classifier>all</classifier>
@@ -78,7 +81,7 @@ under the License.
                                         <prefix>/etc</prefix>
                                     </mapper>
                                 </data>
-                                <!-- opt/sling - jar files -->
+                                <!-- opt/sling - jar files -->`
                                 <data>
                                     <src>${project.build.directory}/opt/sling</src>
                                     <type>directory</type>

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

[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

Posted by ro...@apache.org.
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>.

[sling-launchpad-debian] 15/15: SLING-7167 Adjust READMEs

Posted by ro...@apache.org.
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 83d720cc28cdea2def458e21303167d239a65bc6
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Oct 3 10:05:31 2017 +0000

    SLING-7167 Adjust READMEs
    
    add uniform header linking to Sling project
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1810911 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index c5e4014..1d6df39 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,6 @@
-Apache Sling debian/ubuntu packaging
-====================================
+# Apache Sling Launchpad Debian Package Builder
+
+This module is part of the [Apache Sling](https://sling.apache.org) project.
 
 This is a work in progress .deb packaging for Sling.
 It provides basic init.d start/stop logrotate & sample sling config. The goal is to provide a generic yet configurable sling package to eliminate the need to build sling for in-house deployments.

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