<commit_before>#!/bin/bash

RUN_DIR=/var/vcap/sys/run/splunk-forwarder
LOG_DIR=/var/vcap/sys/log/splunk-forwarder
JOB_DIR=/var/vcap/jobs/splunk-forwarder
PACKAGE_DIR=/var/vcap/packages/splunk
PIDFILE=${RUN_DIR}/pid

case $1 in

  start)
    mkdir -p ${RUN_DIR} ${LOG_DIR}
    mkdir -p ${PACKAGE_DIR}/etc/system/local
    mkdir -p ${PACKAGE_DIR}/etc/apps/splunk_httpinput/local

    chown -R vcap:vcap ${RUN_DIR} ${LOG_DIR} ${PACKAGE_DIR}/

    echo $$ > ${PIDFILE}

    ln -fs ${JOB_DIR}/config/system_local/* ${PACKAGE_DIR}/etc/system/local/
    ln -fs ${JOB_DIR}/config/apps_splunk_httpinput_local/* ${PACKAGE_DIR}/etc/apps/splunk_httpinput/local/

    exec chpst -u vcap:vcap /var/vcap/packages/splunk/bin/splunk start --accept-license \
      >>  $LOG_DIR/forwarder.stdout.log \
      2>> $LOG_DIR/forwarder.stderr.log

    ;;

  stop)
    /var/vcap/packages/splunk/bin/splunk stop<commit_msg>Ensure no prompt in Splunk init script<commit_after>#!/bin/bash

RUN_DIR=/var/vcap/sys/run/splunk-forwarder
LOG_DIR=/var/vcap/sys/log/splunk-forwarder
JOB_DIR=/var/vcap/jobs/splunk-forwarder
PACKAGE_DIR=/var/vcap/packages/splunk
PIDFILE=${RUN_DIR}/pid

case $1 in

  start)
    mkdir -p ${RUN_DIR} ${LOG_DIR}
    mkdir -p ${PACKAGE_DIR}/etc/system/local
    mkdir -p ${PACKAGE_DIR}/etc/apps/splunk_httpinput/local

    chown -R vcap:vcap ${RUN_DIR} ${LOG_DIR} ${PACKAGE_DIR}/

    echo $$ > ${PIDFILE}

    ln -fs ${JOB_DIR}/config/system_local/* ${PACKAGE_DIR}/etc/system/local/
    ln -fs ${JOB_DIR}/config/apps_splunk_httpinput_local/* ${PACKAGE_DIR}/etc/apps/splunk_httpinput/local/

    exec chpst -u vcap:vcap /var/vcap/packages/splunk/bin/splunk start --accept-license  --no-prompt --answer-yes\
      >>  $LOG_DIR/forwarder.stdout.log \
      2>> $LOG_DIR/forwarder.stderr.log

    ;;

  stop)
    /var/vcap/packages/splunk/bin/splunk stop
{'fraction_non_alphanumeric': 0.1594360086767896, 'fraction_numerical': 0.0021691973969631237, 'mean_word_length': 3.511002444987775, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4615194', 'n_tokens_mistral': 770, 'n_tokens_neox': 724, 'n_words': 105}