Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merged master into dasrecht branch

  • Loading branch information...
commit 80aaeec7d630bafed9f8ba91ec9642f8d98f5815 2 parents 385e36e + 455f515
Dan authored
35 README → README.md
Source Rendered
... ... @@ -1,15 +1,16 @@
1 1 Simple script to start / stop a Jackrabbit server.
2 2
3   -Author: D. Barsotti <daniel.barsotti@liip.ch>
  3 +Author: D. Barsotti <daniel.barsotti@liip.ch>, B. Widmer <bastian.widmer@liip.ch>
4 4
5   -
6   -A script to start and stop apache jackrabbit according to the init.d mechanism
7   -
8   -This relies on a PID file to check if Jackrabbit is running.
9   -If you kill Jackrabbit without removing the PID file, you will not be able to start Jackrabbit with this script until you manually remove the PID file.
  5 +Introduction
  6 +============
  7 +This relies on a PID file to check if Jackrabbit is running or not.
  8 +If you kill Jackrabbit without removing the PID file, you will not be
  9 +able to start Jackrabbit with this script before you manually removed
  10 +the PID file.
10 11
11 12 Installation
12   -------------
  13 +============
13 14
14 15 mkdir -p /opt/jackrabbit-startup # or wherever you want to put the code
15 16 cd /opt/jackrabbit-startup
@@ -22,11 +23,10 @@ Installation
22 23 # if not using a system that provides update-rc.d, you hopefully know how
23 24 # to proceed...
24 25
25   -
26 26 Usage
27   ------
  27 +=====
28 28
29   -The service should be started and stopped automatically from now on.
  29 +The service should be started and stopped automatically from now on.
30 30
31 31 If you ever want to control it manually, you can run
32 32
@@ -37,3 +37,18 @@ jackrabbit again. You will get an error on stop that you can ignore.
37 37
38 38 /etc/init.d/jackrabbit stop
39 39 /etc/init.d/jackrabbit start
  40 +
  41 +
  42 +JMX Monitoring
  43 +==============
  44 +The default JMX-Port for monitoring is set to 1111.
  45 +You have to copy the jmx.user.template and jmx.group.template to the directory where your
  46 +Jackrabbit JAR file is stored and remove the .template suffix
  47 +
  48 +In the User file you should specify a different password for your admin user.
  49 +
  50 +Memory Settings
  51 +===============
  52 +You can Tweak the Memory Settings with the Values Xmx (Maximal Memory) Xms (Start Memory)
  53 +and MaxPermSize (Size of Maximum permanent generation heap)
  54 +
34 jackrabbit.sh
@@ -21,29 +21,42 @@
21 21
22 22
23 23 ### PLEASE EDIT THESE VALUES FOR YOUR SETUP
24   -# directory in which jackrabbit will store local data, must be writeable
  24 +# Directory in which jackrabbit will store local data, must be writeable
25 25 BASEDIR=/home/dev/jackalope/jackrabbit
26   -# full filename of jackrabbit standalone .jar to run
27   -JACKRABBIT_JAR=$BASEDIR/jackrabbit-standalone-2.2.8-jackalope-SNAPSHOT.jar
28   -# ip address for jackrabbit to listen on. you can make jackrabbit listen on all
  26 +# Full filename of jackrabbit standalone .jar to run
  27 +JACKRABBIT_JAR=$BASEDIR/jackrabbit-standalone-2.3.2.jar
  28 +# IP address for jackrabbit to listen on. you can make jackrabbit listen on all
29 29 # interfaces by using 0.0.0.0 here.
30 30 JACKRABBIT_HOST=127.0.0.1
31   -# port number to listen on. 8080 is default, you can use something else
  31 +# Port number to listen on. 8080 is default, you can use something else
32 32 JACKRABBIT_PORT=8080
33   -###
34   -
35   -# full filename to the pid file to check if jackrabbit is running
  33 +# JMX-Port for monitoring
  34 +JMX_PORT=1111
  35 +# Java memory allocation
  36 +MEMORY="-XX:MaxPermSize=128m \
  37 + -Xmx512M \
  38 + -Xms128M"
  39 +# JMX Management Parameters
  40 +MANAGEMENT="-Dcom.sun.management.jmxremote \
  41 + -Dcom.sun.management.jmxremote.port=$JMX_PORT \
  42 + -Dcom.sun.management.jmxremote.authenticate=true \
  43 + -Dcom.sun.management.jmxremote.ssl=false \
  44 + -Dcom.sun.management.jmxremote.password.file=$BASEDIR/jmx.user \
  45 + -Dcom.sun.management.jmxremote.access.file=$BASEDIR/jmx.role"
  46 +# Full filename to the pid file to check if jackrabbit is running
36 47 PIDFILE=$BASEDIR/jackrabbit.pid
37   -# full filename to the logfile to output console output of jackrabbit
  48 +# Full filename to the logfile to output console output of jackrabbit
38 49 # additionally, jackrabbit has its own logfile
39 50 LOGFILE=$BASEDIR/jackrabbit.log
  51 +###
40 52
  53 +# Uncomment to debug the script
41 54 #set -x
42 55
43 56 do_start() {
44 57 if [ ! -f $PIDFILE ]; then
45 58 cd $BASEDIR
46   - nohup java -jar $JACKRABBIT_JAR -h $JACKRABBIT_HOST -p $JACKRABBIT_PORT >> $LOGFILE 2>&1 & echo $! > $PIDFILE
  59 + nohup java $MEMORY $MANAGEMENT -jar $JACKRABBIT_JAR -h $JACKRABBIT_HOST -p $JACKRABBIT_PORT >> $LOGFILE 2>&1 & echo $! > $PIDFILE
47 60 echo "Jackrabbit started"
48 61 else
49 62 echo "Jackrabbit is already running"
@@ -83,4 +96,3 @@ case "$1" in
83 96 exit 3
84 97 ;;
85 98 esac
86   -
2  jmx.roles.template
... ... @@ -0,0 +1,2 @@
  1 +admin readwrite
  2 +readonly readonly
2  jmx.user.template
... ... @@ -0,0 +1,2 @@
  1 +admin thisIsSupposedToBeAStrongPassword!
  2 +readonly readonly

0 comments on commit 80aaeec

Please sign in to comment.
Something went wrong with that request. Please try again.