pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/www/apache-tomcat6/files Improvements from spz@
details: https://anonhg.NetBSD.org/pkgsrc/rev/3246e2b012af
branches: trunk
changeset: 397455:3246e2b012af
user: adrianp <adrianp%pkgsrc.org@localhost>
date: Wed Aug 12 20:07:57 2009 +0000
description:
Improvements from spz@
diffstat:
www/apache-tomcat6/files/tomcat.sh | 29 +++++++++++++++++++++++++----
1 files changed, 25 insertions(+), 4 deletions(-)
diffs (78 lines):
diff -r d9b4de539878 -r 3246e2b012af www/apache-tomcat6/files/tomcat.sh
--- a/www/apache-tomcat6/files/tomcat.sh Wed Aug 12 18:11:24 2009 +0000
+++ b/www/apache-tomcat6/files/tomcat.sh Wed Aug 12 20:07:57 2009 +0000
@@ -1,6 +1,6 @@
#! @RCD_SCRIPTS_SHELL@
#
-# $NetBSD: tomcat.sh,v 1.1.1.1 2009/02/14 12:02:09 adrianp Exp $
+# $NetBSD: tomcat.sh,v 1.2 2009/08/12 20:07:57 adrianp Exp $
#
# PROVIDE: tomcat
# REQUIRE: DAEMON
@@ -14,6 +14,7 @@
name="tomcat"
rcvar=$name
command="@TOMCAT_HOME@/bin/catalina.sh"
+pidfile="@VARBASE@/run/tomcat/catalina.pid"
tomcat_user="@TOMCAT_USER@"
tomcat_group="@TOMCAT_GROUP@"
start_cmd="$command start"
@@ -23,6 +24,7 @@
version_cmd="tomcat_version"
debug_cmd="tomcat_debug"
extra_commands="run version debug"
+start_precmd="tomcat_precmd"
PREFIX=@PREFIX@
@@ -34,8 +36,10 @@
CATALINA_HOME=@TOMCAT_HOME@
TOMCAT_HOME=@TOMCAT_HOME@
+CATALINA_PID=${pidfile}
export CATALINA_HOME
export TOMCAT_HOME
+export CATALINA_PID
CLASSPATH=${CLASSPATH}:${PREFIX}/lib/java/servlet.jar:${PREFIX}/lib/java/jaxp.jar:${PREFIX}/lib/java/parser.jar:${PREFIX}/lib/java/crimson.jar:${PREFIX}/lib/java/ant.jar
@@ -45,19 +49,36 @@
fi
export CLASSPATH
+tomcat_precmd()
+{
+ if [ ! -d @VARBASE@/run/tomcat ]; then
+ @MKDIR@ @VARBASE@/run/tomcat
+ @CHMOD@ 0750 @VARBASE@/run/tomcat
+ @CHOWN@ ${tomcat_user}:${tomcat_group} @VARBASE@/run/tomcat
+ fi
+}
+
+tomcat_start()
+{
+ cd $CATALINA_HOME/logs
+ @SU@ ${tomcat_user} -c "${command} start"
+}
+
tomcat_run()
{
- ${command} run
+ cd ${CATALINA_HOME}/logs
+ @SU@ ${tomcat_user} -c "${command} run"
}
tomcat_version()
{
- ${command} version
+ @SU@ ${tomcat_user} -c "${command} version"
}
tomcat_debug()
{
- ${command} debug
+ cd ${CATALINA_HOME}/logs
+ @SU@ ${tomcat_user} -c "${command} debug"
}
if [ -f /etc/rc.subr ]
Home |
Main Index |
Thread Index |
Old Index