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

# file managed by puppet

. <%= basedir %>/bin/setenv.sh

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

case "$1" in
  start)
    $SU tomcat -c "umask 0002; $CATALINA_HOME/bin/catalina.sh start"
    RETVAL=$?
    ;;

  stop)
    $SU tomcat -c "$CATALINA_HOME/bin/catalina.sh stop -force"
    RETVAL=$?
  ;;

  restart)
    $SU tomcat -c "$CATALINA_HOME/bin/catalina.sh stop -force"
    sleep 5
    $SU tomcat -c "umask 0002; $CATALINA_HOME/bin/catalina.sh start"
    RETVAL=$?
  ;;

esac

exit $RETVAL
<commit_msg>tomcat: moved stop/start to functions in initscript<commit_after>#!/bin/sh
# chkconfig: 2345 20 80
# description: Handle tomcat instance <%= name %>

# file managed by puppet

. <%= basedir %>/bin/setenv.sh

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

function start() {
  $SU tomcat -c "umask 0002; $CATALINA_HOME/bin/catalina.sh start"
}

function stop() {
  $SU tomcat -c "$CATALINA_HOME/bin/catalina.sh stop -force"
}

case "$1" in
  start)
    start
    RETVAL=$?
    ;;

  stop)
    stop
    RETVAL=$?
  ;;

  restart)
    stop
    sleep 5
    start
    RETVAL=$?
  ;;

esac

exit $RETVAL

{'fraction_non_alphanumeric': 0.14776883686905634, 'fraction_numerical': 0.023408924652523776, 'mean_word_length': 2.82122905027933, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2235040', 'n_tokens_mistral': 609, 'n_tokens_neox': 536, 'n_words': 147}