]> git.pld-linux.org Git - packages/tomcat.git/blobdiff - apache-tomcat.init
- set default values of env variables in init, not in sysconfig
[packages/tomcat.git] / apache-tomcat.init
index f09f91e1db28f1fd28289eba7f3578e069822b03..d06c6199686a281d1b34b8b95cefc016b26ae7bf 100644 (file)
 # Get network config
 . /etc/sysconfig/network
 
+CATALINA_BASE=/var/lib/tomcat
+CATALINA_OPTS="-Xmx384M -XX:MaxPermSize=192m -XX:PermSize=128m -Djava.library.path=/usr/lib64:/usr/lib"
+JAVA_HOME=$(. /usr/share/java-utils/java-functions; set_jvm >&2; echo "$JAVA_HOME")
+
 # Get service config - may override defaults
 [ -f /etc/sysconfig/tomcat ] && . /etc/sysconfig/tomcat
 
+export CATALINA_BASE
+export CATALINA_OPTS
+export JAVA_OPTS
+export JAVA_HOME
+
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
        if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
@@ -33,7 +42,7 @@ start() {
        if [ ! -f /var/lock/subsys/tomcat ]; then
                msg_starting tomcat
                busy
-               su - http -s /bin/sh -c /usr/share/tomcat/bin/startup.sh >/dev/null 2>&1
+               su tomcat -s /bin/sh -c '/usr/share/tomcat/bin/catalina.sh start' >/dev/null 2>&1
                [ $? -ne 0 ] && RETVAL=1
                if [ $RETVAL -eq 0 ]; then
                        ok
@@ -51,7 +60,7 @@ stop() {
                # Stop daemons.
                msg_stopping tomcat
                busy
-               su - http -s /bin/sh -c /usr/share/tomcat/bin/shutdown.sh >/dev/null 2>&1
+               su tomcat -s /bin/sh -c '/usr/share/tomcat/bin/catalina.sh stop -force' >/dev/null 2>&1
                [ $? -eq 0 ] && ok || fail
                rm -f /var/lock/subsys/tomcat
        else
@@ -89,7 +98,7 @@ case "$1" in
        condrestart 7
        ;;
   status)
-       echo "Not supported (yet?)"
+       status tomcat java
        RETVAL=0
        ;;
   *)
This page took 0.064865 seconds and 4 git commands to generate.