<commit_before>#!/bin/bash

### BEGIN INIT INFO
# Provides:          solr
# Required-Start:
# Required-Stop:
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: init script for solr search
# Description:       init script for solr search
### END INIT INFO

# source function library
. /etc/rc.d/init.d/functions

PIDFILE=<%= @pid_file %>

LOG_FILE=<%= @log_file %>

NAME="Solr"

DESC="start/stop Solr Server"

start() {
    if [ -f $PIDFILE ]; then
        PID=`cat $PIDFILE`
        echo $NAME already running: $PID
    else
        action "Starting ${NAME}: " daemon --pidfile $PIDFILE /var/lib/solr.start
    fi<commit_msg>Verify solr process is actually running if PID file exists when attempting to start<commit_after>#!/bin/bash

### BEGIN INIT INFO
# Provides:          solr
# Required-Start:
# Required-Stop:
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: init script for solr search
# Description:       init script for solr search
### END INIT INFO

# source function library
. /etc/rc.d/init.d/functions

PIDFILE=<%= @pid_file %>

LOG_FILE=<%= @log_file %>

NAME="Solr"

DESC="start/stop Solr Server"

start() {
    if [ -f $PIDFILE ]; then
        status -p $PIDFILE solr
        if [ $? != 0 ]; then
          echo Removing stale PID file: $PIDFILE and starting $NAME
          rm -f $PIDFILE
          start
        fi
    else
        action "Starting ${NAME}: " daemon --pidfile $PIDFILE /var/lib/solr.start
    fi
{'fraction_non_alphanumeric': 0.12491559756920999, 'fraction_numerical': 0.008777852802160702, 'mean_word_length': 2.6146341463414635, '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': '4304141', 'n_tokens_mistral': 527, 'n_tokens_neox': 488, 'n_words': 154}