freebsd-ports/www/resin2/files/resin.sh.in
Greg Lewis 5dce3730a4 . Avoid conflict between resin2 and resin3
. Fix resin{2,3}ctl first line (perl path)
. Pid file is no more created in the Makefile
. New resin.sh startup script, manages pid file
. pkg-[de]install and pkg-message are now generated
. Do not write anything after including bsd.port.post.mk
. Packages are now supported (reported by Arcadius Ahouansou)
. Integration with apxs for [de]activating mod_caucho

PR:		57566
Submitted by:	Jean-Baptiste Quenot <jbq@caraldi.com> (maintainer)
2003-11-20 21:25:09 +00:00

53 lines
1.2 KiB
Bash

#!/bin/sh
#
# Resin startup script.
#
# Borrowed from jakarta-tomcat41
#
# $FreeBSD$
#
# Determine PREFIX
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${0##*/}\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 1
fi
# Set some variables
MYSELF=`basename $0`
ARGS="-conf $PREFIX/etc/%%APP_NAME%%.xml \
-chdir \
-name %%APP_NAME%% \
-class com.caucho.server.http.HttpServer \
-pid %%PID_FILE%%"
PATH=/usr/sbin:/usr/bin:/bin
export JAVA_HOME=%%JAVA_HOME%%
export RESIN_HOME=$PREFIX/%%APP_NAME%%
set -e
case "$1" in
start)
echo -n ' '
truncate -s 0 %%PID_FILE%%
chown %%RUNASUSER%%:%%GROUP%% %%PID_FILE%%
chmod 600 %%PID_FILE%%
su -f -m %%RUNASUSER%% -c "exec $PREFIX/sbin/%%APP_NAME%%ctl $ARGS start" \
>/dev/null && echo -n '%%APP_NAME%%'
;;
stop)
echo -n ' '
chown %%RUNASUSER%%:%%GROUP%% %%PID_FILE%%
chmod 600 %%PID_FILE%%
su -f -m %%RUNASUSER%% -c "exec $PREFIX/sbin/%%APP_NAME%%ctl $ARGS stop" \
>/dev/null 2>&1 ; echo -n '%%APP_NAME%%'
;;
*)
echo ""
echo "Usage: ${MYSELF} { start | stop }"
echo ""
exit 64
;;
esac