#!/usr/bin/execlineb -P
# On Debian/Ubuntu /run/mysqld is provided by tmpfiles.d (d /run/mysqld 0755
# mysql mysql -). systemd-tmpfiles does not run under s6, so the unit creates
# the directory itself -- and under THIS name: run-script-daemon only
# creates /run/$(basename "$DAEMON"), i.e. /run/mariadbd, and no client looks
# for the socket there. mysql-s6 gets by without this mkdir because there
# basename mysqld happens to match /run/mysqld; here it does not.
if { install -d -m 0755 -o mysql -g mysql /run/mysqld }
# Readiness is not "process is running": mariadbd opens the socket only
# after recovering the InnoDB logs. The check in data/check is the proof,
# -n30 the time frame.
s6-notifyoncheck -d -n30 --
run-script-daemon mariadb
