3933c7e
#!/bin/sh
3933c7e
#
3933c7e
# Wrapper script for Jetty5, to be sure it will allways
5dd50a3
# be run with correct user profile (jetty by default)
3933c7e
#
3933c7e
# derived from stuff in tomcat5.init
3933c7e
#
3933c7e
# Gomez Henri <hgomez@slib.fr>
3933c7e
# Keith Irwin <keith_irwin@non.hp.com>
3933c7e
# Nicolas Mailhot <nicolas.mailhot@one2team.com>
3933c7e
#
3933c7e
# version 1.01 - Fix webapps dir permissions
3933c7e
#
3933c7e
3933c7e
[ -r /etc/java/java.conf ] && . /etc/java/java.conf
3933c7e
export JAVA_HOME
3933c7e
3933c7e
# Path to the jetty launch script
5dd50a3
JETTY_SCRIPT=/usr/bin/djetty
3933c7e
3933c7e
# Jetty name :)
5dd50a3
JETTY_PROG=jetty
3933c7e
5dd50a3
# if JETTY_USER is not set, use jetty
3933c7e
if [ -z "$JETTY_USER" ]; then
5dd50a3
    JETTY_USER="jetty"
3933c7e
fi
3933c7e
5dd50a3
# if JETTY_HOME is not set, use /usr/share/jetty
3933c7e
if [ -z "$JETTY_HOME" ]; then
5dd50a3
    JETTY_HOME="/usr/share/jetty"
3933c7e
fi
3933c7e
3933c7e
pushd ${JETTY_HOME}/ext
3933c7e
    rm -f jcert.jar
3933c7e
    ln -s $(build-classpath jsse/jcert)
3933c7e
    rm -f jnet.jar
3933c7e
    ln -s $(build-classpath jsse/jnet)
3933c7e
    rm -f jsse.jar
3933c7e
    ln -s $(build-classpath jsse/jsse)
3933c7e
popd
3933c7e
3933c7e
3933c7e
3933c7e
RETVAL=0
3933c7e
3933c7e
su - $JETTY_USER -c "$JETTY_SCRIPT $@"
3933c7e
RETVAL=$?
3933c7e
exit $RETVAL