3 # tomcat Jakarta Tomcat Servlet/JSP container
7 # description: Jakarta Tomcat Servlet/JSP container
12 # Source function library
13 . /etc/rc.d/init.d/functions
16 . /etc/sysconfig/network
18 # Get service config - may override defaults
19 [ -f /etc/sysconfig/tomcat ] && . /etc/sysconfig/tomcat
21 # Check that networking is up.
22 if is_yes "${NETWORKING}"; then
23 if [ ! -f /var/lock/subsys/network -a != stop -a != status ]; then
24 # nls "ERROR: Networking is down. %s can't be run." <service>
25 msg_network_down tomcat
33 # See how we were called.
36 # Check if the service is already running?
37 if [ ! -f /var/lock/subsys/tomcat ]; then
38 # show "Starting %s service" tomcat
41 su - http -s /bin/sh -c /usr/lib/tomcat/bin/startup.sh >/dev/null 2>&1
42 [ $? -ne 0 ] && RETVAL=1
43 [ $RETVAL -eq 0 ] && ok || fail
44 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/tomcat
46 # show "%s service is already running." tomcat
47 msg_already_running tomcat
51 if [ -f /var/lock/subsys/tomcat ]; then
53 # show "Stopping %s service" tomcat
56 su - http -s /bin/sh -c /usr/lib/tomcat/bin/shutdown.sh >/dev/null 2>&1
57 [ $? -eq 0 ] && ok || fail
58 rm -f /var/lock/subsys/tomcat
60 # show "%s service is not running." tomcat
61 msg_not_running tomcat
70 echo "Not supported (yet?)"
74 # show "Usage: %s {start|stop|restart|force-reload|status}"
75 msg_usage "$0 {start|stop|restart|force-reload|status}"
81 # This must be last line !
82 # vi:syntax=sh:tw=78:ts=8:sw=4