/[packages]/updates/2/tomcat/current/SOURCES/tomcat-7.0-tomcat-sysd
ViewVC logotype

Diff of /updates/2/tomcat/current/SOURCES/tomcat-7.0-tomcat-sysd

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 338836 by schedbot, Sun May 27 17:50:45 2012 UTC revision 338837 by dmorgan, Fri Jan 4 23:34:49 2013 UTC
# Line 9  Line 9 
9  # SERVICE_NAME is a required value only if the service name is  # SERVICE_NAME is a required value only if the service name is
10  # different from 'tomcat'  # different from 'tomcat'
11  #  #
12  NAME="${SERVICE_NAME:-tomcat}"  export NAME="${SERVICE_NAME:-tomcat}"
13    
14  #I'll bet this isn't required.  #I'll bet this isn't required.
15  # unset ISBOOT  # unset ISBOOT
# Line 42  if [ -r "/etc/sysconfig/${NAME}" ]; then Line 42  if [ -r "/etc/sysconfig/${NAME}" ]; then
42      . /etc/sysconfig/${NAME}      . /etc/sysconfig/${NAME}
43  fi  fi
44    
 function parseOptions() {  
     options=""  
     options="$options $(  
                  awk '!/^#/ && !/^$/ { ORS=" "; print "export ", $0, ";" }' \  
                  $TOMCAT_CFG  
              )"  
     if [ -r "/etc/sysconfig/${NAME}" ]; then  
         options="$options $(  
                      awk '!/^#/ && !/^$/ { ORS=" ";  
                                            print "export ", $0, ";" }' \  
                      /etc/sysconfig/${NAME}  
                  )"  
     fi  
     TOMCAT_SCRIPT="$options ${TOMCAT_SCRIPT}"  
 }  
   
45  # See how we were called.  # See how we were called.
46  function start() {  function start() {
47      # fix permissions on the log and pid files      # fix permissions on the log and pid files
48      export CATALINA_PID="/var/run/${NAME}.pid"      export CATALINA_PID="/var/run/${NAME}.pid"
     touch $CATALINA_PID 2>&1  
     if [ "$?" -eq "0" ]; then  
       chown ${TOMCAT_USER}:${TOMCAT_USER} $CATALINA_PID  
     fi  
49    
50      touch $TOMCAT_LOG 2>&1      touch $TOMCAT_LOG 2>&1
51      if [ "$?" -eq "0" ]; then      if [ "$?" -eq "0" ]; then
52        chown ${TOMCAT_USER}:${TOMCAT_USER} $TOMCAT_LOG        chown ${TOMCAT_USER}:${TOMCAT_USER} $TOMCAT_LOG
53      fi      fi
54    
     parseOptions    
55      if [ "$SECURITY_MANAGER" = "true" ]; then      if [ "$SECURITY_MANAGER" = "true" ]; then
56         $SU - $TOMCAT_USER -c "${TOMCAT_SCRIPT} start-security" >> $TOMCAT_LOG 2>&1         ${TOMCAT_SCRIPT} start-security >> $TOMCAT_LOG 2>&1
57      else      else
58         $SU - $TOMCAT_USER -c "${TOMCAT_SCRIPT} start" >> $TOMCAT_LOG 2>&1         ${TOMCAT_SCRIPT} start #>> $TOMCAT_LOG 2>&1
59      fi      fi
60  }  }
61    
62  function stop() {  function stop() {
63      parseOptions        ${TOMCAT_SCRIPT} stop >> $TOMCAT_LOG 2>&1
     $SU - $TOMCAT_USER -c "${TOMCAT_SCRIPT} stop" >> $TOMCAT_LOG 2>&1  
64  }  }
65    
66  # See how we were called.  # See how we were called.

Legend:
Removed from v.338836  
changed lines
  Added in v.338837

  ViewVC Help
Powered by ViewVC 1.1.30