]> git.pld-linux.org Git - packages/apache-tomcat.git/blob - apache-tomcat.init
- it is apache tomcat now (cvs admin please cp spec)
[packages/apache-tomcat.git] / apache-tomcat.init
1 #!/bin/sh
2 #
3 # tomcat        Jakarta Tomcat Servlet/JSP container
4 #
5 # chkconfig:    345  84 16
6 #
7 # description:  Jakarta Tomcat Servlet/JSP container
8 #
9 # $Id$
10
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 # Get network config
16 . /etc/sysconfig/network
17
18 # Get service config - may override defaults
19 [ -f /etc/sysconfig/tomcat ] && . /etc/sysconfig/tomcat
20
21 # Check that networking is up.
22 if is_yes "${NETWORKING}"; then
23         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
24                 msg_network_down tomcat
25                 exit 1
26         fi
27 else
28         exit 0
29 fi
30
31 RETVAL=0
32 # See how we were called.
33 case "$1" in
34   start)
35         # Check if the service is already running?
36         if [ ! -f /var/lock/subsys/tomcat ]; then
37                 msg_starting tomcat
38                 busy
39                 su - http -s /bin/sh -c /usr/lib/tomcat/bin/startup.sh >/dev/null 2>&1
40                 [ $? -ne 0 ] && RETVAL=1
41                 [ $RETVAL -eq 0 ] && ok || fail
42                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/tomcat
43         else
44                 msg_already_running tomcat
45         fi
46         ;;
47   stop)
48         if [ -f /var/lock/subsys/tomcat ]; then
49                 # Stop daemons.
50                 msg_stopping tomcat
51                 busy
52                 su - http -s /bin/sh -c /usr/lib/tomcat/bin/shutdown.sh >/dev/null 2>&1
53                 [ $? -eq 0 ] && ok || fail
54                 rm -f /var/lock/subsys/tomcat
55         else
56                 msg_not_running tomcat
57         fi
58         ;;
59   restart|force-reload)
60         $0 stop
61         $0 start
62         exit $?
63         ;;
64   status)
65         echo "Not supported (yet?)"
66         RETVAL=0
67         ;;
68   *)
69         msg_usage "$0 {start|stop|restart|force-reload|status}"
70         exit 3
71 esac
72
73 exit $RETVAL
74
75 # This must be last line !
76 # vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.059882 seconds and 3 git commands to generate.