<commit_before>#!/bin/bash

if [ -f /etc/debian/version ]; then
  >&2 echo "Runners wrapper doesn't support debian platforms right now!"
  exit 1
else
  # redhatish and simply other platforms, they must support systemd
  sv=systemd
  svbin=/usr/bin/systemctl
  if [ -x $svbin ]; then
    >&2 echo "Non systemd platforms are not supported"
    exit 1
  fi
fi

WORKERSNUM=${WORKERSNUM:-`nproc`}
action="$1"; shift;
for i in `seq $WORKERSNUM`; do
  [ "$sv" = "systemd" ] && $svbin $action st2actionrunner@$i
done<commit_msg>runners.sh support for sysv, systemd, upstart platforms<commit_after>#!/bin/sh

SYSTEMDCTL=/usr/bin/systemctl
UPSTARTCTL=/sbin/initctl
WORKER=st2actionrunner-worker

# 1. Choose init type
if [ -x $SYSTEMDCTL ]; then
  sv=systemd
  svbin=$SYSTEMDCTL
elif [ -x $UPSTARTCTL ]; then
  sv=upstart
  svbin=$UPSTARTCTL
else
  # Old debians, redhats and centos, amazon etc
  sv=sysv
  svbin=/etc/init.d/$WORKER
  if [ ! -x $svbin ]; then
    >&2 echo "Init file not found: $svbin"
    >&2 echo "Unknown platform, we support ONLY debian, systemd and sysv!"
    exit 1
  fi
fi

# 2. Spwan workers
WORKERSNUM=${WORKERSNUM:-`nproc`}
action="$1"; shift;
rs=0
for i in `seq $WORKERSNUM`; do
  if [ $sv = systemd ]; then
    $svbin $action st2actionrunner@$i
  elif [ $sv = upstart ]; then
    $svbin $action st2actionrunner WORKERID=$i
  elif [ $sv = sysv ]; then
    WORKERID=$i $svbin $action
  fi
  cmdrs=$?
  [ $cmdrs -gt 0 ] && rs=$cmdrs
done

exit $rs
{'fraction_non_alphanumeric': 0.1325136612021858, 'fraction_numerical': 0.011612021857923498, 'mean_word_length': 3.710610932475884, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6057584', 'n_tokens_mistral': 573, 'n_tokens_neox': 542, 'n_words': 165}