430490 Added JETTY_SHELL

426738 Fixed JETTY_HOME comments
This commit is contained in:
Greg Wilkins 2014-03-21 13:54:23 +11:00
parent 0d1fca545c
commit 18f75011b4
1 changed files with 15 additions and 4 deletions

View File

@ -48,9 +48,8 @@ NAME=$(echo $(basename $0) | sed -e 's/^[SK][0-9]*//' -e 's/\.sh$//')
# #
# JETTY_HOME # JETTY_HOME
# Where Jetty is installed. If not set, the script will try go # Where Jetty is installed. If not set, the script will try go
# guess it by first looking at the invocation path for the script, # guess it by looking at the invocation path for the script
# and then by looking in standard locations as $HOME/opt/jetty # The java system property "jetty.home" will be
# and /opt/jetty. The java system property "jetty.home" will be
# set to this value for use by configure.xml files, f.e.: # set to this value for use by configure.xml files, f.e.:
# #
# <Arg><Property name="jetty.home" default="."/>/webapps/jetty.war</Arg> # <Arg><Property name="jetty.home" default="."/>/webapps/jetty.war</Arg>
@ -74,6 +73,12 @@ NAME=$(echo $(basename $0) | sed -e 's/^[SK][0-9]*//' -e 's/\.sh$//')
# #
# JETTY_USER # JETTY_USER
# if set, then used as a username to run the server as # if set, then used as a username to run the server as
#
# JETTY_SHELL
# If set, then used as the shell by su when starting the server. Will have
# no effect if start-stop-daemon exists. Useful when JETTY_USER does not
# have shell access, e.g. /bin/false
#
usage() usage()
{ {
@ -417,10 +422,16 @@ case "$ACTION" in
if [ "$JETTY_USER" ] if [ "$JETTY_USER" ]
then then
unset SU_SHELL
if [ "$JETTY_SHELL" ]
then
SU_SHELL="-s $JETTY_SHELL"
fi
touch "$JETTY_PID" touch "$JETTY_PID"
chown "$JETTY_USER" "$JETTY_PID" chown "$JETTY_USER" "$JETTY_PID"
# FIXME: Broken solution: wordsplitting, pathname expansion, arbitrary command execution, etc. # FIXME: Broken solution: wordsplitting, pathname expansion, arbitrary command execution, etc.
su - "$JETTY_USER" -c " su - "$JETTY_USER" $SU_SHELL -c "
exec ${RUN_CMD[*]} start-log-file="$JETTY_LOGS/start.log" & exec ${RUN_CMD[*]} start-log-file="$JETTY_LOGS/start.log" &
disown \$! disown \$!
echo \$! > '$JETTY_PID'" echo \$! > '$JETTY_PID'"