<commit_before>#!/bin/bash
#
# Scripts to run by MySQL systemd service
#
# Needed argument: pre | post
#
# pre mode  :  try to perform sanity check for configuration, log, data
# post mode :  ping server until answer is received

sanity () {
if [ ! -r /etc/mysql/my.cnf ]; then
echo "MySQL configuration not found at /etc/mysql/my.cnf. Please create one."
exit 1
fi

if [ ! -d /var/lib/mysql ] && [ ! -L /var/lib/mysql ]; then
echo "MySQL data dir not found at /var/lib/mysql. Please create one."
exit 1
fi

if [ ! -d /var/lib/mysql/mysql ] && [ ! -L /var/lib/mysql/mysql ]; then
echo "MySQL system database not found. Please run mysql_install_db tool."
exit 1
fi
}

pinger () {
server_up=false
for i in $(seq 1 30); do
sleep 1
if mysqladmin ping >/dev/null 2>&1; then
server_up=true<commit_msg>Added comments<commit_after>#!/bin/bash
#
# Scripts to run by MySQL systemd service
#
# Needed argument: pre | post
#
# pre mode  :  try to perform sanity check for configuration, log, data
# post mode :  ping server until answer is received
#
# The source of the file can be found:
# source-location: https://launchpadlibrarian.net/265197909/mysql-5.7_5.7.13.orig.tar.gz
# file-location: ./packaging/deb-jessie/extra/mysql-systemd-start

sanity () {
if [ ! -r /etc/mysql/my.cnf ]; then
echo "MySQL configuration not found at /etc/mysql/my.cnf. Please create one."
exit 1
fi

if [ ! -d /var/lib/mysql ] && [ ! -L /var/lib/mysql ]; then
echo "MySQL data dir not found at /var/lib/mysql. Please create one."
exit 1
fi

if [ ! -d /var/lib/mysql/mysql ] && [ ! -L /var/lib/mysql/mysql ]; then
echo "MySQL system database not found. Please run mysql_install_db tool."
exit 1
fi
}

pinger () {
server_up=false
for i in $(seq 1 30); do
sleep 1
if mysqladmin ping >/dev/null 2>&1; then
server_up=true
{'fraction_non_alphanumeric': 0.13206491326245104, 'fraction_numerical': 0.01846670397313934, 'mean_word_length': 3.3823529411764706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 1, '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': '2135241', 'n_tokens_mistral': 665, 'n_tokens_neox': 626, 'n_words': 224}