<commit_before>#!/bin/bash
# description: Tomcat Start Stop Restart
# Nikolay <-
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=<%= scope.lookupvar('tomcat::java_home') %>
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=<%= scope.lookupvar('tomcat::web_home') %>

start() {
  if [ ! -f /var/lock/subsys/tomcat ]; then
      echo -n $"Starting $prog: "
      /bin/su tomcat /usr/local/tomcat/bin/startup.sh

      RETVAL=$?
      [ $RETVAL -eq 0 ] && touch /var/lock/subsys/tomcat
      echo
  fi
  return $RETVAL
}

stop() {
  echo -n $"Stopping $prog: "
  /usr/local/tomcat/bin/shutdown.sh
  RETVAL=$?
  [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/tomcat

  return $RETVAL
}


restart() {
  stop
  start<commit_msg>Fixed the init script<commit_after>#!/bin/bash
# description: Tomcat Start Stop Restart
# Nikolay <-
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=<%= scope.lookupvar('tomcat::java_home') %>
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=<%= scope.lookupvar('tomcat::web_home') %>

start() {
  if [ ! -f /var/lock/subsys/tomcat ]; then
      echo -n $"Starting $prog: "
      /usr/bin/sudo -u tomcat /usr/local/tomcat/bin/startup.sh

      RETVAL=$?
      [ $RETVAL -eq 0 ] && touch /var/lock/subsys/tomcat
      echo
  fi
  return $RETVAL
}

stop() {
  echo -n $"Stopping $prog: "
  /usr/local/tomcat/bin/shutdown.sh
  RETVAL=$?
  [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/tomcat

  return $RETVAL
}


restart() {
  stop
  start
{'fraction_non_alphanumeric': 0.16323822163238222, 'fraction_numerical': 0.011944260119442602, 'mean_word_length': 3.1542699724517904, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6303938', 'n_tokens_mistral': 651, 'n_tokens_neox': 591, 'n_words': 127}