Skip to content
Snippets Groups Projects
Commit 7a72e19f authored by Vincent Massol's avatar Vincent Massol
Browse files

XWIKI-11088: Add -h parameter support for start/stop scripts

parent 96f10133
No related branches found
No related tags found
No related merge requests found
...@@ -26,19 +26,18 @@ ...@@ -26,19 +26,18 @@
# JVM to 1GB, use set XWIKI_OPTS=-Xmx1024m # JVM to 1GB, use set XWIKI_OPTS=-Xmx1024m
# JETTY_PORT - the port on which to start Jetty. # JETTY_PORT - the port on which to start Jetty.
# JETTY_STOP_PORT - the port on which Jetty listens for a Stop command. # JETTY_STOP_PORT - the port on which Jetty listens for a Stop command.
#
# Optional Parameters
# -------------------
# -p, --port: The Jetty HTTP port to use. Overrides any value from JETTY_PORT. Defaults to 8080.
# -sp, --stopport: The Jetty stop port to use. Overrides any value from JETTY_STOP_PORT. Defaults to 8079.
# -ld, --lockdir: The directory where the executing process id is stored to verify that that only one instance is
# started. Defaults to /var/tmp.
#
# Example
# -------
# start_xwiki.sh -p 8080 -sp 8079 -k
# ---------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------
usage() {
echo "Usage: start_xwiki.sh <optional parameters>"
echo "-p, --port: The Jetty HTTP port to use. Overrides any value from JETTY_PORT. Defaults to 8080."
echo "-sp, --stopport: The Jetty stop port to use. Overrides any value from JETTY_STOP_PORT. Defaults to 8079."
echo "-ld, --lockdir: The directory where the executing process id is stored to verify that that only one instance"
echo " is started. Defaults to /var/tmp."
echo ""
echo "Example: start_xwiki.sh -p 8080 -sp 8079"
}
# Ensure that the commands below are always started in the directory where this script is located. # Ensure that the commands below are always started in the directory where this script is located.
# To do this we compute the location of the current script. # To do this we compute the location of the current script.
PRG="$0" PRG="$0"
...@@ -91,8 +90,14 @@ while [[ $# > 0 ]]; do ...@@ -91,8 +90,14 @@ while [[ $# > 0 ]]; do
XWIKI_LOCK_DIR="$1" XWIKI_LOCK_DIR="$1"
shift shift
;; ;;
-h|--help)
usage
exit 1
;;
*) *)
# unknown option # unknown option
usage
exit 1
;; ;;
esac esac
done done
......
...@@ -26,22 +26,21 @@ ...@@ -26,22 +26,21 @@
# JVM to 1GB, use set XWIKI_OPTS=-Xmx1024m # JVM to 1GB, use set XWIKI_OPTS=-Xmx1024m
# JETTY_PORT - the port on which to start Jetty. # JETTY_PORT - the port on which to start Jetty.
# JETTY_STOP_PORT - the port on which Jetty listens for a Stop command. # JETTY_STOP_PORT - the port on which Jetty listens for a Stop command.
#
# Optional Parameters
# -------------------
# -p, --port: The Jetty HTTP port to use. Overrides any value from JETTY_PORT. Defaults to 8080.
# -sp, --stopport: The Jetty stop port to use. Overrides any value from JETTY_STOP_PORT. Defaults to 8079.
# -ld, --lockdir: The directory where the executing process id is stored to verify that that only one instance is
# started. Defaults to /var/tmp.
# -yp, --yourkitpath: The path where Yourkit can find the agent. If not passed then YourKit won't be enabled.
# For example: "/Applications/YourKit Java Profiler 7.0.11.app/bin/mac"
# or "/home/User/yjp-11.0.8/bin/linux-x86-64/"
#
# Example
# -------
# start_xwiki_debug.sh -yp "/Applications/YourKit Java Profiler 7.0.11.app/bin/mac"
# ---------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------
usage() {
echo "Usage: start_xwiki.sh <optional parameters>"
echo "-p, --port: The Jetty HTTP port to use. Overrides any value from JETTY_PORT. Defaults to 8080."
echo "-sp, --stopport: The Jetty stop port to use. Overrides any value from JETTY_STOP_PORT. Defaults to 8079."
echo "-ld, --lockdir: The directory where the executing process id is stored to verify that that only one instance"
echo " is started. Defaults to /var/tmp."
echo "-yp, --yourkitpath: The path where Yourkit can find the agent. If not passed then YourKit won't be enabled."
echo " For example: \"/Applications/YourKit Java Profiler 7.0.11.app/bin/mac\""
echo " or \"/home/User/yjp-11.0.8/bin/linux-x86-64/\""
echo ""
echo "Example: start_xwiki_debug.sh -yp \"/Applications/YourKit Java Profiler 7.0.11.app/bin/mac\""
}
# Ensure that the commands below are always started in the directory where this script is located. # Ensure that the commands below are always started in the directory where this script is located.
# To do this we compute the location of the current script. # To do this we compute the location of the current script.
PRG="$0" PRG="$0"
...@@ -100,8 +99,14 @@ while [[ $# > 0 ]]; do ...@@ -100,8 +99,14 @@ while [[ $# > 0 ]]; do
YOURKIT_PATH="$1" YOURKIT_PATH="$1"
shift shift
;; ;;
-h|--help)
usage
exit 1
;;
*) *)
# unknown option # unknown option
usage
exit 1
;; ;;
esac esac
done done
......
...@@ -24,20 +24,20 @@ ...@@ -24,20 +24,20 @@
# ----------------- # -----------------
# XWIKI_OPTS - parameters passed to the Java VM when running XWiki e.g. to increase the memory allocated to the # XWIKI_OPTS - parameters passed to the Java VM when running XWiki e.g. to increase the memory allocated to the
# JVM to 1GB, use set XWIKI_OPTS=-Xmx1024m # JVM to 1GB, use set XWIKI_OPTS=-Xmx1024m
# JETTY_PORT - the port on which Jetty was started.
# JETTY_STOP_PORT - the port on which Jetty listens for a Stop command. # JETTY_STOP_PORT - the port on which Jetty listens for a Stop command.
#
# Optional Parameters
# -------------------
# -p, --port: The Jetty HTTP port that was used to start XWiki. Defaults to 8080.
# -sp, --stopport: The Jetty stop port to use. Overrides any value from JETTY_STOP_PORT. Defaults to 8079.
# -ld, --lockdir: The directory where the executing process id is stored to verify that that only one instance is
# started. Defaults to /var/tmp.
#
# Example
# -------
# stop_xwiki.sh -sp 8079
# ---------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------
usage() {
echo "Usage: stop_xwiki.sh <optional parameters>"
echo "-p, --port: The Jetty HTTP port that was used to start XWiki. Defaults to 8080."
echo "-sp, --stopport: The Jetty stop port to use. Overrides any value from JETTY_STOP_PORT. Defaults to 8079."
echo "-ld, --lockdir: The directory where the executing process id is stored to verify that that only one instance"
echo " is started. Defaults to /var/tmp."
echo ""
echo "Example: stop_xwiki.sh -p 8080 -sp 8079"
}
waitForLockDeletion() { waitForLockDeletion() {
# Wait till the XWiki lock file is removed by the start script # Wait till the XWiki lock file is removed by the start script
# Wait 20 seconds at most and exits if the lock file hasn't been removed after that. # Wait 20 seconds at most and exits if the lock file hasn't been removed after that.
...@@ -97,8 +97,14 @@ while [[ $# > 0 ]]; do ...@@ -97,8 +97,14 @@ while [[ $# > 0 ]]; do
XWIKI_LOCK_DIR="$1" XWIKI_LOCK_DIR="$1"
shift shift
;; ;;
-h|--help)
usage
exit 1
;;
*) *)
# unknown option # unknown option
usage
exit 1
;; ;;
esac esac
done done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment