Changeset View
Standalone View
databases/mysqlwsrep56-server/files/mysql-server.in
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
pidfile=${mysql_pidfile:-"${mysql_dbdir}/${hostname}.pid"} | pidfile=${mysql_pidfile:-"${mysql_dbdir}/${hostname}.pid"} | ||||
command="/usr/sbin/daemon" | command="/usr/sbin/daemon" | ||||
command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_optfile} --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}" | command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_optfile} --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}" | ||||
procname="%%PREFIX%%/libexec/mysqld" | procname="%%PREFIX%%/libexec/mysqld" | ||||
start_precmd="${name}_prestart" | start_precmd="${name}_prestart" | ||||
start_postcmd="${name}_poststart" | start_postcmd="${name}_poststart" | ||||
mysql_install_db="%%PREFIX%%/bin/mysql_install_db" | mysql_install_db="%%PREFIX%%/bin/mysql_install_db" | ||||
mysql_install_db_args="--basedir=%%PREFIX%% --defaults-extra-file=${mysql_optfile} --datadir=${mysql_dbdir} --force" | mysql_install_db_args="--basedir=%%PREFIX%% --defaults-extra-file=${mysql_optfile} --datadir=${mysql_dbdir} --force" | ||||
service_startup_timeout=900 | |||||
startup_sleep=1 | |||||
sst_progress_file=${mysql_dbdir}/sst_in_progress | |||||
extra_commands="bootstrap" | |||||
bootstrap_cmd="mysql_bootstrap" | |||||
mysql_bootstrap() | |||||
mmokhi: Why not moving it to `bootstrap` or `precmd` part? | |||||
Done Inline ActionsIs this even necessary? I'll ask the submitter. lifanov: Is this even necessary? I'll ask the submitter. | |||||
Not Done Inline ActionsA separate "bootstrap" command is introduced in order to align the FreeBSD script with the equivalent scripts on Linux. Not sure if this answers your question. philip.stoev_galeracluster.com: A separate "bootstrap" command is introduced in order to align the FreeBSD script with the… | |||||
Not Done Inline Actions
Is such alignment needed on local FreeBSD? mmokhi: > A separate "bootstrap" command is introduced in order to align the FreeBSD script with the… | |||||
Not Done Inline ActionsHaving the "bootstrap" options makes all the blog posts and documentation from Linux land applicable to FreeBSD, hopefully making adoption easier. Furthermore, a derivative Galera product such as Percona XtraDB Cluster includes this option. philip.stoev_galeracluster.com: Having the "bootstrap" options makes all the blog posts and documentation from Linux land… | |||||
Not Done Inline ActionsI see, Makes sense. mmokhi: I see, Makes sense.
Just was a personal opinion.
For sure, If keeping bootstrap makes it… | |||||
{ | |||||
# Bootstrap the cluster, start the first node that initiate the cluster | |||||
check_startmsgs && echo "Bootstrapping cluster" | |||||
shift | |||||
command_args="$command_args --wsrep-new-cluster" | |||||
run_rc_command ${_rc_prefix}start | |||||
} | |||||
mysql_create_auth_tables() | mysql_create_auth_tables() | ||||
{ | { | ||||
eval $mysql_install_db $mysql_install_db_args >/dev/null 2>/dev/null | eval $mysql_install_db $mysql_install_db_args >/dev/null 2>/dev/null | ||||
[ $? -eq 0 ] && chown -R ${mysql_user}:${mysql_user} ${mysql_dbdir} | [ $? -eq 0 ] && chown -R ${mysql_user}:${mysql_user} ${mysql_dbdir} | ||||
} | } | ||||
mysql_prestart() | mysql_prestart() | ||||
{ | { | ||||
if [ ! -d "${mysql_dbdir}/mysql/." ]; then | if [ ! -d "${mysql_dbdir}/mysql/." ]; then | ||||
mysql_create_auth_tables || return 1 | mysql_create_auth_tables || return 1 | ||||
fi | fi | ||||
if checkyesno mysql_limits; then | if checkyesno mysql_limits; then | ||||
eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null | eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null | ||||
else | else | ||||
return 0 | return 0 | ||||
fi | fi | ||||
} | } | ||||
mysql_poststart() | mysql_poststart() | ||||
{ | { | ||||
local timeout=15 | local timeout=${service_startup_timeout} | ||||
while [ ! -f "${pidfile}" -a ${timeout} -gt 0 ]; do | while [ ! -f "${pidfile}" -a ${timeout} -gt 0 ]; do | ||||
if test -e $sst_progress_file && [ $startup_sleep -ne 100 ]; then | |||||
check_startmsgs && echo "SST in progress, setting sleep higher" | |||||
startup_sleep=100 | |||||
fi | |||||
timeout=$(( timeout - 1 )) | timeout=$(( timeout - 1 )) | ||||
sleep 1 | sleep $startup_sleep | ||||
done | done | ||||
return 0 | return 0 | ||||
} | } | ||||
run_rc_command "$1" | run_rc_command "$1" |
Why not moving it to bootstrap or precmd part?