<commit_before>#!/bin/bash

DATA_HOME="/var/lib/mysql"
RUN_HOME="/var/run/mysql"

SYSTEM_UID=${MARIADB_UID:-"1000"}
SYSTEM_UID_TYPE=$( [ ${MARIADB_UID} ] && echo "preset" || echo "default" )

echo "==> Updating mysql system user's ID to ${SYSTEM_UID} (${SYSTEM_UID_TYPE})"
usermod -u ${SYSTEM_UID} mysql > /dev/null 2>&1 &

echo "==> Updating ownership of data directory (${DATA_HOME})"
chown -R mysql "${DATA_HOME}"

echo "==> Updating ownership of run directory (${RUN_HOME})"
mkdir -p "${RUN_HOME}"
chown -R mysql "${RUN_HOME}"

if [[ ! -d "${DATA_HOME}/mysql" ]]; then
    echo "==> An empty or uninitialized MariaDB installation is detected in '${DATA_HOME}'"
    echo "==> Installing MariaDB data..."
    mysql_install_db > /dev/null 2>&1
    echo "==> Done!"

    /usr/bin/mysqld_safe > /dev/null 2>&1 &

    RET=1
    while [[ RET -ne 0 ]]; do
        echo "==> Waiting for confirmation of MariaDB service startup..."
        sleep 2<commit_msg>Stopped task running in background causing race condition.<commit_after>#!/bin/bash

DATA_HOME="/var/lib/mysql"
RUN_HOME="/var/run/mysqld"

SYSTEM_UID=${MARIADB_UID:-"1000"}
SYSTEM_UID_TYPE=$( [ ${MARIADB_UID} ] && echo "preset" || echo "default" )

echo "==> Updating mysql system user's ID to ${SYSTEM_UID} (${SYSTEM_UID_TYPE})"
usermod -u ${SYSTEM_UID} mysql > /dev/null 2>&1

echo "==> Updating ownership of data directory (${DATA_HOME})"
mkdir -p "${DATA_HOME}"
chown -R mysql "${DATA_HOME}"

echo "==> Updating ownership of run directory (${RUN_HOME})"
mkdir -p "${RUN_HOME}"
chown -R mysql "${RUN_HOME}"

if [[ ! -d "${DATA_HOME}/mysql" ]]; then
    echo "==> An empty or uninitialized MariaDB installation is detected in '${DATA_HOME}'"
    echo "==> Installing MariaDB data..."
    mysql_install_db > /dev/null 2>&1
    echo "==> Done!"

    /usr/bin/mysqld_safe > /dev/null 2>&1 &

    RET=1
    while [[ RET -ne 0 ]]; do
        echo "==> Waiting for confirmation of MariaDB service startup..."
        sleep 2
{'fraction_non_alphanumeric': 0.1773049645390071, 'fraction_numerical': 0.013171225937183385, 'mean_word_length': 3.8645320197044337, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, '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': '7516697', 'n_tokens_mistral': 718, 'n_tokens_neox': 684, 'n_words': 195}