mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-12 03:00:28 +00:00
databases/mariadb104-server: Fix breakage
* Unbreak clean installs (USERS/GROUPS) * INSTALL_UNIX_ADDRDIR is a FILE, add the socket filename * Built-in socket path now confirmed to be consistent between client, lib and daemon PR: 247747 Submitted by: VVD <vvd unislabs com> Reported by: dinoex MFH: 2020Q3
This commit is contained in:
parent
8a80027708
commit
cc3103894d
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=542085
@ -3,7 +3,7 @@
|
||||
|
||||
PORTNAME?= mariadb
|
||||
PORTVERSION= 10.4.13
|
||||
PORTREVISION?= 3
|
||||
PORTREVISION?= 4
|
||||
CATEGORIES= databases
|
||||
MASTER_SITES= http://mirrors.supportex.net/${SITESDIR}/ \
|
||||
http://mirror2.hs-esslingen.de/pub/Mirrors/${SITESDIR}/ \
|
||||
@ -42,6 +42,7 @@ MARIADB_USER?= mysql
|
||||
MARIADB_GROUP?= mysql
|
||||
|
||||
MARIADB_RUNDIR?= /var/run/mysql
|
||||
MARIADB_SOCK?= mysql.sock
|
||||
MARIADB_LOGDIR?= /var/log/mysql
|
||||
|
||||
OPTIONS_SINGLE= GSSAPI
|
||||
@ -93,7 +94,7 @@ CMAKE_ARGS+= -DINSTALL_DOCDIR="share/doc/mysql" \
|
||||
-DINSTALL_SUPPORTFILESDIR="share/mysql" \
|
||||
-DDEFAULT_SYSCONFDIR="${PREFIX}/etc" \
|
||||
-DDEFAULT_SYSCONF2DIR="${ETCDIR}/conf.d" \
|
||||
-DINSTALL_UNIX_ADDRDIR="${MARIADB_RUNDIR}" \
|
||||
-DINSTALL_UNIX_ADDRDIR="${MARIADB_RUNDIR}/${MARIADB_SOCK}" \
|
||||
-DWITH_SSL="${OPENSSLBASE}" \
|
||||
-DCURSES_CURSES_LIBRARY="/usr/lib/libcurses.so" \
|
||||
-DCURSES_FORM_LIBRARY="/usr/lib/libform.so" \
|
||||
@ -122,7 +123,8 @@ GSSAPI_MIT_USES= gssapi:mit
|
||||
GSSAPI_NONE_CMAKE_ON= -DPLUGIN_AUTH_GSSAPI_CLIENT=OFF
|
||||
OPTIONS_SUB= yes
|
||||
SUB_LIST+= MARIADB_USER="${MARIADB_USER}" \
|
||||
MARIADB_RUNDIR="${MARIADB_RUNDIR}"
|
||||
MARIADB_RUNDIR="${MARIADB_RUNDIR}" \
|
||||
MARIADB_SOCK="${MARIADB_SOCK}"
|
||||
PLIST_SUB+= MARIADB_USER="${MARIADB_USER}" \
|
||||
MARIADB_GROUP="${MARIADB_GROUP}"
|
||||
|
||||
@ -139,6 +141,8 @@ PLIST_SUB+= MARIADB_RUNDIR="${MARIADB_RUNDIR}"
|
||||
USES+= mysql:104m
|
||||
USE_LDCONFIG+= ${PREFIX}/lib/mysql/plugin
|
||||
USE_RC_SUBR= mysql-server
|
||||
USERS= ${MARIADB_USER}
|
||||
GROUPS= ${MARIADB_GROUP}
|
||||
CMAKE_ON+= CMAKE_SKIP_BUILD_RPATH WITH_EMBEDDED_SERVER
|
||||
CMAKE_OFF+= WITH_CLIENT
|
||||
SUB_FILES+= server.cnf.sample
|
||||
|
@ -5,7 +5,7 @@
|
||||
#
|
||||
[client-server]
|
||||
port = 3306
|
||||
socket = %%MARIADB_RUNDIR%%/mysql.sock
|
||||
socket = %%MARIADB_RUNDIR%%/%%MARIADB_SOCK%%
|
||||
|
||||
#
|
||||
# include *.cnf from the config directory
|
||||
|
@ -12,14 +12,17 @@
|
||||
%%LEGACY_LIMITS%%# mysql_(instance_)?limits (bool): Set to "NO" by default.
|
||||
%%LEGACY_LIMITS%%# Set it to yes to run `limits -e -U mysql`
|
||||
%%LEGACY_LIMITS%%# just before mysql starts.
|
||||
# mysql_(instance_)?dbdir (str): Default to "/var/db/mysql"
|
||||
# Base database directory.
|
||||
# mysql_(instance_)?dbdir (str): Base database directory.
|
||||
# Default to "/var/db/mysql"
|
||||
# mysql_(instance_)?args (str): Custom additional arguments to be passed
|
||||
# to mysqld_safe (default empty).
|
||||
# mysql_(instance_)?pidfile (str): Custum PID file path and name.
|
||||
# Default to "${mysql_dbdir}/${hostname}.pid".
|
||||
# mysql_(instance_)?user (str): User to run mysqld as
|
||||
# Default to "mysql" created by the port
|
||||
# mysql_(instance_)?user (str): User to run mysqld as.
|
||||
# Default to "%%MARIADB_USER%%" created by the port
|
||||
# mysql_(instance_)?socket (str): Name of the socket file.
|
||||
# Default to "" and used from %%ETCDIR%%/my.cnf,
|
||||
# where default is "%%MARIADB_RUNDIR%%/%%MARIADB_SOCK%%".
|
||||
# mysql_(instance_)?optfile (str): Server-specific option file.
|
||||
# Default to "${mysql_dbdir}/my.cnf".
|
||||
# mysql_instances (str): Set to "" by default.
|
||||
@ -34,7 +37,7 @@ load_rc_config $name
|
||||
|
||||
: ${mysql_enable="NO"}
|
||||
%%LEGACY_LIMITS%%: ${mysql_limits="NO"}
|
||||
: ${mysql_user="mysql"}
|
||||
: ${mysql_user="%%MARIADB_USER%%"}
|
||||
%%LEGACY_LIMITS%%mysql_limits_args="-e -U ${mysql_user}"
|
||||
: ${mysql_dbdir="/var/db/mysql"}
|
||||
: ${mysql_optfile="${mysql_dbdir}/my.cnf"}
|
||||
@ -54,6 +57,7 @@ if [ -n "$2" ]; then
|
||||
%%LEGACY_LIMITS%%eval mysql_limits="\${mysql_${instance}_limits:-\"${mysql_limits}\"}"
|
||||
eval mysql_user="\${mysql_${instance}_user:-\"${mysql_user}\"}"
|
||||
%%LEGACY_LIMITS%%eval mysql_limits_args="\${mysql_${instance}_limits_args:-\"-e -U $mysql_user\"}"
|
||||
eval mysql_socket="\${mysql_${instance}_socket:-\"${mysql_socket}\"}"
|
||||
eval mysql_optfile="\${mysql_${instance}_optfile:-\"${mysql_dbdir}/my.cnf\"}"
|
||||
eval mysql_pidfile="\${mysql_${instance}_pidfile:-\"${mysql_dbdir}/`/bin/hostname`.pid\"}"
|
||||
;;
|
||||
@ -99,7 +103,7 @@ fi
|
||||
pidfile=$mysql_pidfile
|
||||
mysql_install_db="%%PREFIX%%/bin/mysql_install_db"
|
||||
mysql_install_db_args="--basedir=%%PREFIX%% --datadir=${mysql_dbdir} --force"
|
||||
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_socket:+--socket=${mysql_socket}} ${mysql_args}"
|
||||
|
||||
mysql_create_auth_tables()
|
||||
{
|
||||
@ -119,6 +123,11 @@ mysql_prestart()
|
||||
if [ ! -d "${mysql_dbdir}/mysql/." ]; then
|
||||
mysql_create_auth_tables || return 1
|
||||
fi
|
||||
[ "${mysql_socket}" = "" ] && mysql_rundir="%%MARIADB_RUNDIR%%" || mysql_rundir="`/usr/bin/dirname ${mysql_socket}`"
|
||||
if [ ! -d "${mysql_rundir}" ]; then
|
||||
install -d -o ${mysql_user} -g %%MARIADB_GROUP%% "${mysql_rundir}"
|
||||
|
||||
fi
|
||||
%%LEGACY_LIMITS%% if checkyesno mysql_limits; then
|
||||
%%LEGACY_LIMITS%% eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null
|
||||
%%LEGACY_LIMITS%% else
|
||||
|
@ -14,12 +14,12 @@
|
||||
[mysqld]
|
||||
user = %%MARIADB_USER%%
|
||||
# port = 3306 # inherited from %%ETCDIR%%/my.cnf
|
||||
# socket = %%MARIADB_RUNDIR%%/mysql.sock # inherited from %%ETCDIR%%/my.cnf
|
||||
# socket = %%MARIADB_RUNDIR%%/%%MARIADB_SOCK%% # inherited from %%ETCDIR%%/my.cnf
|
||||
bind-address = 127.0.0.1
|
||||
basedir = %%PREFIX%%
|
||||
datadir = /var/db/mysql
|
||||
net_retry_count = 16384
|
||||
log_error = %%MARIADB_LOGDIR%%/${hostname}.err
|
||||
log_error = %%MARIADB_LOGDIR%%/mysqld.err
|
||||
# [mysqld] configuration for ZFS
|
||||
# From https://www.percona.com/resources/technical-presentations/zfs-mysql-percona-technical-webinar
|
||||
# Create separate datasets for data and logs, eg
|
||||
|
Loading…
Reference in New Issue
Block a user