]> git.pld-linux.org Git - packages/apache-tomcat.git/blobdiff - apache-tomcat.init
- why builders try to install jsse? It should be disabled by bcond.
[packages/apache-tomcat.git] / apache-tomcat.init
index ed8eccf668c43501e5edd1c085ab1088f8c6d8b7..540f74f9823a1d02a2b94e21be38b7959bf66b33 100644 (file)
@@ -33,7 +33,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/startup.sh >/dev/null 2>&1
                [ $? -ne 0 ] && RETVAL=1
                if [ $RETVAL -eq 0 ]; then
                        ok
@@ -51,7 +51,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/shutdown.sh >/dev/null 2>&1
                [ $? -eq 0 ] && ok || fail
                rm -f /var/lock/subsys/tomcat
        else
@@ -59,6 +59,16 @@ stop() {
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/tomcat ]; then
+               stop
+               start
+       else
+               msg_not_running tomcat
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -68,16 +78,22 @@ case "$1" in
   stop)
        stop
        ;;
-  restart|force-reload)
+  restart)
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
   status)
        echo "Not supported (yet?)"
        RETVAL=0
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
        exit 3
 esac
 
This page took 0.045197 seconds and 4 git commands to generate.