derby revision d47b7213b7d5cd8f5fc70757b746342924488cf8
# Startup script for Apache Derby
#
# Software License Agreement (BSD License)
#
# Copyright (c) 2011, Trond Norbye
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# distribution.
#
# * The names of the contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "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 COPYRIGHT
# OWNER 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.
### BEGIN INIT INFO
# Provides: derby
# Required-Start: $network $local_fs
# Required-Stop: $network $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start Apache Derby
### END INIT INFO
#
# execute:
# update-rc.d derby default
#
# Defaults
# Reads config file (will override defaults above)
case "$1" in
log_daemon_msg "Starting Derby"
# exit unless we've got the jar file
test -f ${DERBY_JAR}
if [ $? -ne 0 ]
then
log_failure_msg "Missing file: ${DERBY_JAR}"
exit 1
fi
--start \
--background \
--quiet \
-- \
${DERBY_JVM_OPTIONS} \
if [ $? -ne 0 ]
then
exit 1
fi
;;
stop)
log_daemon_msg "Stopping Derby"
;;
$0 stop
if [ $? -eq 0 ]
then
sleep 1
$0 start
fi
;;
if [ $? -eq 0 ]
then
$0 restart
fi
;;
;;
exit $?
;;
*)
exit 1
;;
esac
exit 0