<commit_before>#!/bin/sh
# chkconfig: 2345 20 80
# description: Handle tomcat instance <%= tomcat_name %>

# file managed by puppet

. /lib/lsb/init-functions

SHUTDOWN_WAIT=30

export JAVA_HOME=<%= javahome %>
export CATALINA_HOME=<%= catalinahome %>
export CATALINA_BASE=<%= basedir %>
export CATALINA_PID=<%= basedir %>/temp/tomcat.pid

# For SELinux we need to use 'runuser' not 'su'
if [ -x "/sbin/runuser" ]; then
    SU="/sbin/runuser"
else
    SU="su"
fi

start() {
  isrunning

  if [ "$?" = 0 ]; then
    echo "tomcat-<%= tomcat_name %> already running"
    return 0
  fi

  # Source JVM parameters
  test -r <%= basedir %>/bin/setenv.sh && . <%= basedir %>/bin/setenv.sh

  # Remove pidfile if still around
  test -f $CATALINA_PID && rm -f $CATALINA_PID

  $SU tomcat -c "umask 0002; $CATALINA_HOME/bin/catalina.sh start" > /dev/null<commit_msg>tomcat init script - change directory to tomcat base dir to prevent relative path problems<commit_after>#!/bin/sh
# chkconfig: 2345 20 80
# description: Handle tomcat instance <%= tomcat_name %>

# file managed by puppet

. /lib/lsb/init-functions

SHUTDOWN_WAIT=30

export JAVA_HOME=<%= javahome %>
export CATALINA_HOME=<%= catalinahome %>
export CATALINA_BASE=<%= basedir %>
export CATALINA_PID=<%= basedir %>/temp/tomcat.pid

# For SELinux we need to use 'runuser' not 'su'
if [ -x "/sbin/runuser" ]; then
    SU="/sbin/runuser"
else
    SU="su"
fi

start() {
  isrunning

  if [ "$?" = 0 ]; then
    echo "tomcat-<%= tomcat_name %> already running"
    return 0
  fi

  # Change directory to prevent path problems
  cd <%= basedir %>
  # Source JVM parameters
  test -r <%= basedir %>/bin/setenv.sh && . <%= basedir %>/bin/setenv.sh

  # Remove pidfile if still around
  test -f $CATALINA_PID && rm -f $CATALINA_PID

  $SU tomcat -c "umask 0002; $CATALINA_HOME/bin/catalina.sh start" > /dev/null
{'fraction_non_alphanumeric': 0.14393530997304582, 'fraction_numerical': 0.01725067385444744, 'mean_word_length': 3.6054590570719602, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 22, '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': '4861007', 'n_tokens_mistral': 790, 'n_tokens_neox': 676, 'n_words': 194}